thanks Kai for your answer!
the issue with find module would be that it would work fine if there would
be only one type of file with one replace in it. But I store in the
variables file multiple type of files that each have different patterns to
search for and replace. I would need in pseudocode a for each syntax that
would run over both find and replace, something like
for each type of file {
find all matching files
replace all resective patterns relative only to this file
}
hope this makes sense :)
On Wednesday, November 15, 2017 at 4:37:46 PM UTC+2, Kai Stian Olstad wrote:
>
> 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/0968b714-bf9e-474a-9e78-4c4572c3646d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.