From 75ae2367d4328763f0a5a93160fc2ad41985c9e6 Mon Sep 17 00:00:00 2001 From: Salt Date: Thu, 20 Feb 2020 03:49:06 -0600 Subject: [PATCH] Separate module enable tasks in apache-php, enable headers --- roles/apache-php/tasks/main.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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