Ansible find module , can path parameter include regex ?

7 views
Skip to first unread message

Saranya N

unread,
May 25, 2018, 8:36:55 AM5/25/18
to Ansible Project
Hi all ,

I'm trying to find files dit.xml under particular directories.

Rather than mentioning the directories as a list like below

Path : [ /opt/local/version_v1.3.1 , /opt/local/version_v1.3.0 ]

I tried /opt/local/version_v1.3.* and it didn't work.

Actually I have dit.xml files under /opt/local/version_v1.5.0 which I don't want to modify.

That's y looking for regex for paths.

Is it possible? Kindly suggest

Kai Stian Olstad

unread,
May 25, 2018, 2:13:22 PM5/25/18
to ansible...@googlegroups.com
Since it's not in the documentation it's not supported.

What you could do is first a find that finds the directories and exclude
the once you don't want.
The result of that find is used in the second find to find the correct
files.

--
Kai Stian Olstad

Saranya Nagaraj

unread,
May 27, 2018, 5:26:10 AM5/27/18
to ansible...@googlegroups.com
Thank you Kai , I'll try that out.

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/1wMwHzLp7-g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/72011b5e9189631b41d1d59d3dfdb94d%40olstad.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages