diff --git a/roles/apache-php/tasks/main.yml b/roles/apache-php/tasks/main.yml index ebbf556..4377098 100644 --- a/roles/apache-php/tasks/main.yml +++ b/roles/apache-php/tasks/main.yml @@ -35,8 +35,17 @@ path: "/etc/apache2/sites-enabled/000-default.conf" state: absent - name: Enable modules - shell: "{{ item }}" - loop: - - "a2enmod rewrite" - - "a2enmod ssl" + 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 become: yes