Hello Experts,

my ansible play book is working for me to uncomment certain lines in a 
.conf file, but its failing for one particular line its not making any 
change.

below is my .conf file part.

->
#<VirtualHost *:443>
 #SSLEnable
 #Header always set Strict-Transport-Security "max-age=31536000; 
includeSubDomains; preload"
#</VirtualHost>
->

Expected output
____________

<VirtualHost *:443>
 SSLEnable
 #Header always set Strict-Transport-Security "max-age=31536000; 
includeSubDomains; preload"
</VirtualHost>

->

below is my play

->
- name: uncomment virtualhost starting line
     replace:
       path: /opt/conf/httpd.conf
       regexp: '^#(.*<VirtualHost *:443>.*)'
       replace: '\1'
 - name: uncomment virtualhost end line
     replace:
       path: /opt/conf/httpd.conf
       regexp: '^#(.*</VirtualHost>.*)'
       replace: '\1'



->

Here my virtualhost end line is getting uncommented but the startline is 
not.. can you please guide me here.....

-- 
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/37bb3c26-97cb-4d66-967e-5f8d5c11fea0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to