On Tuesday, 14 November 2017 17.16.15 CET Andrei Baban wrote: > All works well, but I need to be able to specify files with regexp in the > variables.yml file. Something like below: > > patterns: > - file: file_*.xml > regexp: 17701 > replace: 17706 > - file: other_file.xml > regexp: a > replace: b > > This will fail as replace module will output that 'file_*.xml' cannot be > found > > I can do this by using shell module and sed command but I'd really like to > stick to using the correct modules instead of falling back to bash. Do you > have any suggestion on how to achieve something like this?
To this you would need to use the find module to find the files matching the filename regexp/glob, then feed the filename result into the replace module. -- Kai Stian Olstad -- 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/1929160.6nKg71PxZ2%40x1. For more options, visit https://groups.google.com/d/optout.
