how to use insertbefore/after correctly?

7 views
Skip to first unread message

aaron.t...@total.care

unread,
May 25, 2016, 10:22:04 AM5/25/16
to Ansible Project
lineinfile: dest=/etc/rsyslog.conf insertafter="\*\.\*\;auth\,authpriv\.none" regexp="\*\.\*\;auth\,authpriv\.none" line="Listen 8080"

The only thing that happens here is Listen 8080 replaces the *.*;auth,authpriv.none line.  should it not be placing it after it???

Johannes Kastl

unread,
May 25, 2016, 10:55:44 AM5/25/16
to ansible...@googlegroups.com
I think you don't need the regexp, or rather the regexp should match
the line you are *inserting*. To let ansible know, if the line is
already in there.

Right now you are telling ansible to replace the line
...auth,authpriv... and insert the line after the line ...auth,authpriv...

Johannes


signature.asc
Reply all
Reply to author
Forward
0 new messages