I have a file, as an example, with the following content:
disk = [file:/OVS/Repositories/0004fb0000030000df2ee11376f1cd94/VirtualDisks
/b7558d7745c14b02806d08f8003906e1.img,xvda,w,phy:/OVS/Repositories/
0004fb0000030000df2ee11376f1cd94/VirtualDisks/
0004fb0000120000049ec392e534e039,xvdb,w,file:/OVS/Repositories/
0004fb0000030000df2ee11376f1cd94/VirtualDisks/
0004fb0000120000843bb7e2fe395f24.img,xvdc,w]

I wish to find all instances of image files, and build a list with them.  
Here is my regexp:
(\w+.img)

Here is a regexp tester with all of the above:
https://regex101.com/r/UKcYIa/3

I know that I can do this with shell, or similar modules, but I wish to do 
this in a more ansible-native way (if there is one).   Is there a module 
that will allow me to search a file with a regular expression and then 
register the results to a variable?  I just want to build a list of *img 
files (can be more than 1 and probably wont exceed 10) so that I can 
manipulate them later.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fca87b68-ce68-4c14-840c-ecfba3a7664b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to