Hi everybody,
when I try the following in a playbook (ansible 1.6.2):
- lineinfile:
dest: /etc/nagios/nrpe.cfg
backrefs: yes
regexp: ‘^(allowed_hosts=).*$’
line: ‘\1{{ monitoring_server }}’
where “monitoring_server=10.0.0.5”, it replaces the line “allowed_hosts=127.0.0.1” with “H.0.0.5”.
If I put any character between “\1” and “{{”, it seems to be working correctly, but I don’t want an additional character there.
Thanks and best regards,
Gregor