From 2f169ba97ccb242c8483c18f55253e947b4bce05 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 22 Mar 2017 17:38:46 +0100 Subject: [PATCH] library/roles/apache: manage the installation of the rpaf module. --- apache/defaults/main.yml | 3 +++ apache/tasks/apache-modules.yml | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/apache/defaults/main.yml b/apache/defaults/main.yml index 805a8b9..99a590d 100644 --- a/apache/defaults/main.yml +++ b/apache/defaults/main.yml @@ -26,6 +26,9 @@ apache_worker_modules: - { name: 'mpm_prefork', state: 'absent' } - { name: 'mpm_{{ apache_mpm_mode }}', state: 'present' } +# apache RPAF is needed to obtain the real client addresses when behind a reverse proxy +apache_rpaf_install: False + apache_default_modules: - headers - rewrite diff --git a/apache/tasks/apache-modules.yml b/apache/tasks/apache-modules.yml index 39d2ce7..fe082f3 100644 --- a/apache/tasks/apache-modules.yml +++ b/apache/tasks/apache-modules.yml @@ -1,4 +1,15 @@ --- +- name: Install the libapache2-mod-rpaf module + apt: pkg=libapache2-mod-rpaf state=present + when: apache_rpaf_install + tags: [ 'apache', 'apache_mods', 'apache_rpaf' ] + +- name: Enable the apache rpaf module + apache2_module: name=rpaf state=present + when: apache_rpaf_install + notify: apache2 reload + tags: [ 'apache', 'apache_mods', 'apache_rpaf' ] + - name: Load the apache ssl modules apache2_module: name={{ item }} state=present with_items: '{{ apache_ssl_modules }}'