diff --git a/roles/apache-php/tasks/main.yml b/roles/apache-php/tasks/main.yml index f825332..9fcb279 100644 --- a/roles/apache-php/tasks/main.yml +++ b/roles/apache-php/tasks/main.yml @@ -43,18 +43,27 @@ # This is a symlink so who cares path: "/etc/apache2/sites-enabled/000-default.conf" state: absent - - name: Enable modules + - name: Configure modules block: - - name: Enable rewrite - command: "/usr/sbin/a2enmod rewrite" - args: - creates: /etc/apache2/mods-enabled/rewrite.load - - name: Enable SSL - command: "/usr/sbin/a2enmod ssl" - args: - creates: /etc/apache2/mods-enabled/ssl.load - - name: Enable header modification - command: "/usr/sbin/a2enmod headers" - args: - creates: /etc/apache2/mods-enabled/headers.load + - name: Disable modules + command: + argv: + - "/usr/sbin/a2enmod" + - "{{ item }}" + removes: "/etc/apache2/mods-enabled/{{ item }}.load" + loop: + - mpm_event + notify: restart apache + - name: Enable modules + command: + argv: + - "/usr/sbin/a2enmod" + - "{{ item }}" + creates: "/etc/apache2/mods-enabled/{{ item }}.load" + loop: + - mpm_prefork + - rewrite + - ssl + - headers + notify: restart apache become: yes