Modularize Apache configs

This commit is contained in:
Salt 2020-07-12 09:54:04 -05:00
parent a0c931d4ad
commit 8ff9285b35

View File

@ -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