I want ansible to comment-out all lines in a file, if they aren't already 
commented out. Here's what I have:

replace: dest=/etc/httpd/conf.d/welcome.conf regexp='(^[^#].*)' replace='# \1'

The problem is, the file has some blank lines. When ansible encounters a blank 
line, it comments it out, and then for some reason, skips the next line. I'm 
thinking maybe there's a bug in the way ansible is handling those lines ... Or 
more likely, I've got something screwed up in my regex.

I thought maybe it was using the '.*' to include the newline and the whole next 
line, so I changed it to '.?' with no effect.

I'm also noticing, a blank line shouldn't match the ^[^#] pattern, because it 
doesn't begin with not pound.

Anyway, do you fine people think I've uncovered a bug? Or I've got a buggered 
regex?
_______________________________________________
Tech mailing list
Tech@lists.lopsa.org
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to