From 84f8804932a86598a5740956b6429cf51ebe0825 Mon Sep 17 00:00:00 2001 From: Reio Remma Date: Tue, 14 Jun 2022 12:36:26 +0300 Subject: [PATCH] Disable modules before enable. Disable modules before enable, so that we can switch from mpm_prefork to mpm_event without conflict. --- tasks/manage_modules.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tasks/manage_modules.yml b/tasks/manage_modules.yml index 7e02406..f328758 100644 --- a/tasks/manage_modules.yml +++ b/tasks/manage_modules.yml @@ -1,19 +1,20 @@ --- -- name: Enabling modules +- name: Disabling modules command: > - a2enmod {{ item.id }} + a2dismod {{ item.id }} args: - creates: "/etc/apache2/mods-enabled/{{ item.id }}.load" - when: item.state is not defined or item.state != 'absent' + removes: "/etc/apache2/mods-enabled/{{ item.id }}.load" + when: item.state is defined and item.state == 'absent' with_items: "{{ apache2_modules }}" notify: test and reload apache2 -- name: Disabling modules +- name: Enabling modules command: > - a2dismod {{ item.id }} + a2enmod {{ item.id }} args: - removes: "/etc/apache2/mods-enabled/{{ item.id }}.load" - when: item.state is defined and item.state == 'absent' + creates: "/etc/apache2/mods-enabled/{{ item.id }}.load" + when: item.state is not defined or item.state != 'absent' with_items: "{{ apache2_modules }}" notify: test and reload apache2 +