ansible-role-apache/tasks/apache-modules.yml

80 lines
2.6 KiB
YAML

---
- block:
- name: Load the required modules
apache2_module: name={{ item }} state=present force=yes
with_items: '{{ apache_default_modules }}'
notify: apache2 reload
ignore_errors: True
tags: [ 'apache', 'apache_modules' ]
- name: Manage the RPAF module on Debian or Ubuntu
block:
- name: Install the libapache2-mod-rpaf module
apt: pkg=libapache2-mod-rpaf state=present
when: apache_rpaf_install
- name: Enable the apache rpaf module
apache2_module: name=rpaf state=present
when: apache_rpaf_install
notify: apache2 reload
when: ansible_distribution_file_variety == "Debian"
tags: [ 'apache', 'apache_mods', 'apache_rpaf' ]
- block:
- name: Load the apache ssl modules
apache2_module: name={{ item }} state=present
with_items: '{{ apache_ssl_modules }}'
when: apache_ssl_modules_enabled
notify: apache2 reload
- name: Load some apache proxy modules
apache2_module: name={{ item }} state=present
with_items: '{{ apache_http_proxy_modules }}'
when: apache_http_proxy_modules_enabled
notify: apache2 reload
tags: [ 'apache', 'apache_mods', 'apache_ssl' ]
- name: Manage some optional modules
block:
- name: Load additional apache modules if any
apache2_module: name={{ item }} state=present
with_items: '{{ apache_additional_modules_list }}'
notify: apache2 reload
- name: Disable apache modules if any
apache2_module: name={{ item }} state=absent
with_items: '{{ apache_modules_to_be_removed | default ([]) }}'
notify: apache2 reload
- name: Load the apache status module
apache2_module: name={{ item }} state=present
with_items: status
when: apache_status_module
notify: apache2 reload
tags: [ 'apache', 'apache_mods', 'apache_status' ]
- name: Configure the apache status module
template: src={{ item }}.j2 dest=/etc/apache2/mods-available/{{ item }} owner=root group=root mode=0644
with_items: status.conf
when: apache_status_module
notify: apache2 reload
tags: [ 'apache', 'apache_mods', 'apache_status' ]
- name: Load the apache info module
apache2_module: name={{ item }} state=present
with_items: info
when: apache_info_module
notify: apache2 reload
tags: [ 'apache', 'apache_mods', 'apache_info' ]
- name: Configure the apache info module
template: src={{ item }}.j2 dest=/etc/apache2/mods-available/{{ item }} owner=root group=root mode=0644
with_items: info.conf
when: apache_info_module
notify: apache2 reload
tags: [ 'apache', 'apache_mods', 'apache_info' ]
tags: [ 'apache', 'apache_mods' ]