lineinfile module replace correctly for the first time run the playbook, but not the second time

12 views
Skip to first unread message

lee lyly

unread,
Oct 20, 2016, 1:01:29 PM10/20/16
to Ansible Project
 Below is the sample of the lineinfile module that I used. The first time run the playbook, it successfully change the line with the new line.
However, after I run one more time the playbook, it still add the line at the bottom of the file.


 - name: Change abc
    lineinfile:
      dest: "{{ abc }}"
      state: present
      regexp: '         <column name="PARAM_VALUE">http://{{ ansible_fqdn }}:{{ wabc_port }}</column>'
      line:  '         <column name="PARAM_VALUE">https://{{ ansible_fqdn }}:{{ abc_port_https }}</column>'


How should it works?

Kai Stian Olstad

unread,
Oct 21, 2016, 3:46:21 PM10/21/16
to ansible...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages