lineinfile can be tricky and most times I'd discourage usage of it in favor of the template module.
However, in this case, this feels like a bug report to me. Please be sure to file one on github. On Fri, May 30, 2014 at 4:58 AM, Gregor Giesen <[email protected]> wrote: > 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 > > -- > 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/185ab4d1-de45-42a8-a138-a843d6499107%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/185ab4d1-de45-42a8-a138-a843d6499107%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CA%2BnsWgwViAvMZMGvbjBX1sHpj3tzg_6%2BzKCBXBO%2BR0KJ3j%2BHZA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
