Re: [ansible-project] replace module query

2018-10-02 Thread SUMIT SAHAY
Hi Dick Visser, Thanks for your reply. As per your suggestion I am trying to running the shell module first and registering the output, now what should I do and how I used this register values in replace module to get the required output. - shell: 'awk "/^[[:space:]]*($|#)/{next} /$host_to_

Re: [ansible-project] replace module query

2018-10-01 Thread Vinicius Barreto
Hello Dick, thank you for your response. I started studying Ansible this week and I'm already using on some servers with Ad-Hoc commands. I plan to make some shell scripts and include them in some Playbooks. While planning the creation of these scripts I raised my doubt. However, the answers I rece

Re: [ansible-project] replace module query

2018-10-01 Thread Dick Visser
On Mon, 1 Oct 2018 at 18:25, SUMIT SAHAY 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 va

Re: [ansible-project] replace module query

2018-10-01 Thread SUMIT SAHAY
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 qu

Re: [ansible-project] replace module query

2018-10-01 Thread Dick Visser
On Mon, 1 Oct 2018 at 09:22, SUMIT SAHAY wrote: > > Hi All, > > I have one query regarding ansible replace module, I wrote one ansible > playbook and I used replace module in my ansible playbook, it is running > successfully but without making any changes in file, > > > - replace: > path

[ansible-project] replace module query

2018-10-01 Thread SUMIT SAHAY
Hi All, I have one query regarding ansible replace module, I wrote one ansible playbook and I used replace module in my ansible playbook, it is running successfully but without making any changes in file, - replace: path: /home/xxx/known_host.txt regexp: 'awk "/^[[:space:]]*($|