Re: Issue with "insertafter"

22 views
Skip to first unread message
Message has been deleted

Adam Morris

unread,
Jun 5, 2014, 4:28:54 PM6/5/14
to ansible...@googlegroups.com


On Thursday, June 5, 2014 10:23:18 AM UTC-7, ha...@airseed.com wrote:
When I try to use insertafter to update a local file, it doesn't insert the text after the insertafter text, rather it appends the text at the end.
For eg. - local_action: lineinfile dest="./hosts" regexp="{{ item.public_dns_name }}" insertafter="[masters]" line="{{ item.public_dns_name }}

I think that your problem is that you have both regexp and insertafter.  I would get rid of the regexp and add state=present (just to make it clear that I want that file to be there).

Adam 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages