On Mon, 1 Oct 2018 at 18:25, SUMIT SAHAY <
sumitsa...@gmail.com> wrote:
>
> Hi Dick Visser,
> Thanks for your reply.
> Yeah I want to replace the output of awk with string.
> The playbook is running fine it means it is getting executed without any error, that is what I was trying to say.
>
> Actually the string may vary as per the requirement as of now I used my name to raise my question on Ansible forum.
Hi Sumit
For clarity sake, the 'replace' module "will replace all instances of
a pattern within a file" (as per
https://docs.ansible.com/ansible/latest/modules/replace_module.html).
There is no error because there is nothing to replace.
However, if you mention "running awk first", then you should, well,
run awk first. But I don't see that anywhere.
If you intend to do that, you should use either the 'shell' or the
'command' module first.
Possibly just use a regular expression filter in that same task (and
avoid having two tasks that each need a file to work on).
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#regular-expression-filters
Things would be a lot easier if you were able to provide a real data
sample, and a clear description of what you're exactly trying to
achieve.
Thanks
Dick