it is working now,

with below syntax.

lineinfile: dest=/tmp/node/test.new
                  regexp='^{{ansible_hostname}}'
                  state=absent
      delegate_to: "{{ groups['masters'][0] }}"
      changed_when: False


On Wednesday, March 13, 2019 at 12:30:08 AM UTC+5:30, Deepak Sharma wrote:
>
> this is my host file.
>
> #  cat /tmp/node/test.new
> [masters]
> 1234.abc.com
> [nodes]
> 453.abc.com  openshift_node_labels,22,="{'region': 'us_midwest', 
> 'datacenter': 'ctc', 'zone': 'core', 'environment': 'nonprod', 
> 'logging-infra-fluentd': 'true'}"
> 678abc.com  openshift_node_labels,22,="{'region': 'us_midwest', 
> 'datacenter': 'ctc', 'zone': 'core', 'environment': 'nonprod', 
> 'logging-infra-fluentd': 'true'}"
> #
>
> and i want to delete 453.abc.com whole line from /tmp/node/test.new
>
> with below syntax but getting error, can some one help me
>
>
> lineinfile: dest=/tmp/node/test.new
>               regexp='^{{ansible_hostname}}$'
>               state=absent
>
> but getting error
>

-- 
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/11c6aef8-9b68-45ef-ac2d-4aecfc870263%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to