Hi Adam, Thanks for the reply, but even this way it puts it after [slaves]. I removed the regex and also tried with putting state as present.
On Thursday, June 5, 2014 1:28:54 PM UTC-7, Adam Morris wrote: > > > > On Thursday, June 5, 2014 10:23:18 AM UTC-7, [email protected] 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 > -- 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/5c747803-690d-43d5-b533-36f233d3976d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
