title: Ansible regexp for Apache VirtualHost line
body: <p>I want to replace <code>&lt;VirtualHost *:80&gt;</code> to <code>&lt;VirtualHost *:443&gt;</code> in my apache configuration file using ansible. How should I do that? I tried below but that did not help:</p>
  
  <pre><code>- name: Enable SSL port
    replace: dest="/etc/apache2/sites-enabled/000-default.conf"
             regexp='^&lt;VirtualHost *:80&gt;'
             replace='&lt;VirtualHost *:443&gt;'
    become: true
  </code></pre>