- name: Install Apache package: name: - apache2 - apache2-utils state: present - name: Apache 2 ssl module apache2_module: state: present name: ssl - name: Rewrite module apache2_module: state: present name: rewrite - name: Create virtualhost template: src: vhost.conf.j2 dest: /etc/apache2/sites-available/001-nb.conf - name: Disable default site command: a2dissite 000-default.conf args: removes: /etc/apache2/sites-enabled/000-default.conf - name: Enable mirror virtual host command: a2ensite 001-nb args: creates: /etc/apache2/sites-enabled/001-nb.conf notify: - restart apache2