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 # This is a symlink so who cares
path: "/etc/apache2/sites-enabled/000-default.conf" path: "/etc/apache2/sites-enabled/000-default.conf"
state: absent state: absent
- name: Enable modules - name: Configure modules
block: block:
- name: Enable rewrite - name: Disable modules
command: "/usr/sbin/a2enmod rewrite" command:
args: argv:
creates: /etc/apache2/mods-enabled/rewrite.load - "/usr/sbin/a2enmod"
- name: Enable SSL - "{{ item }}"
command: "/usr/sbin/a2enmod ssl" removes: "/etc/apache2/mods-enabled/{{ item }}.load"
args: loop:
creates: /etc/apache2/mods-enabled/ssl.load - mpm_event
- name: Enable header modification notify: restart apache
command: "/usr/sbin/a2enmod headers" - name: Enable modules
args: command:
creates: /etc/apache2/mods-enabled/headers.load argv:
- "/usr/sbin/a2enmod"
- "{{ item }}"
creates: "/etc/apache2/mods-enabled/{{ item }}.load"
loop:
- mpm_prefork
- rewrite
- ssl
- headers
notify: restart apache
become: yes become: yes