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 }}
hosts file has the following structure - [local] xxxxx [masters] [slaves] The above command should add the text after [masters] and before [slaves], but it adds it after [slaves]. How to insert the text between [masters] and [slaves]? -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ab59b31c-e049-4ee0-8812-e08d79e7bec7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.