My stupidity was at fault...

There is originally a commented out line in the file that ALSO matches the 
regexp I was using.  So, my change was made to the second of two matching 
lines and not the first...  Kind of confusing when using insertbefore...

So I have...

example line 1
# line 2 example

and using line in file I insert "#Ansible test" before "line" and it gets 
put in between lines 1 and 2.  i.e. after line 1 and before line 2.

thus I end up with

example line 1
#Ansible test
# line 2 example

and not 

#Ansible test
example line 1
# line 2 example

as I was expecting...  that behaviour is clearly documented for regexp but 
it might be worth adding a note to "insertbefore" that it will insert 
before the LAST line that matches the regexp.

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/c2fbfdc0-bc53-4c27-b62c-8c26eefd04f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to