From 4b6d16be88e3c3e3c0363740d62150904f181803 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 14 Jul 2015 17:43:27 +0200 Subject: [PATCH] dnet-openaire/virtuoso.yml: add an apache proxy library/roles/apache: enable ssl, proxy and optionally any other module --- apache/defaults/main.yml | 15 +++++++++++++++ apache/tasks/apache-modules.yml | 21 +++++++++++++++++++++ apache/tasks/apache.yml | 9 +++------ apache/tasks/main.yml | 1 + 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 apache/tasks/apache-modules.yml diff --git a/apache/defaults/main.yml b/apache/defaults/main.yml index dec3dae5..11202f9d 100644 --- a/apache/defaults/main.yml +++ b/apache/defaults/main.yml @@ -16,6 +16,16 @@ apache_default_modules: - expires - xsendfile +apache_ssl_modules_enabled: True +apache_ssl_modules: + - ssl + - socache_shmcb +apache_http_proxy_modules_enabled: False +apache_http_proxy_modules: + - proxy + - proxy_ajp + - proxy_http + apache_basic_auth: False apache_basic_auth_single_file: True apache_basic_auth_dir: /etc/apache2/auth @@ -30,3 +40,8 @@ apache_basic_auth_modules: # apache_basic_users: # - { username:'', password:'', state:'present,absent', auth_file:'path_to_file' } +# +# Set this variable to load the modules you need +#apache_additional_modules: +# - +# - diff --git a/apache/tasks/apache-modules.yml b/apache/tasks/apache-modules.yml new file mode 100644 index 00000000..c27953b5 --- /dev/null +++ b/apache/tasks/apache-modules.yml @@ -0,0 +1,21 @@ +--- +- 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 + tags: [ 'apache', 'apache_mods' ] + +- 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' ] + +- name: Load additional apache modules if any + apache2_module: name={{ item }} state=present + with_items: apache_additional_modules + when: apache_additional_modules is defined + notify: apache2 reload + tags: [ 'apache', 'apache_mods' ] diff --git a/apache/tasks/apache.yml b/apache/tasks/apache.yml index c2a9e981..b984f8ea 100644 --- a/apache/tasks/apache.yml +++ b/apache/tasks/apache.yml @@ -2,15 +2,13 @@ - name: Install the apache packages apt: pkg={{ item }} state=installed force=yes with_items: apache_packages - tags: - - apache + tags: apache - name: Load the required modules apache2_module: name={{ item }} state=present with_items: apache_default_modules notify: apache2 reload - tags: - - apache + tags: apache - name: Remove the default virtualhost file file: dest=/etc/apache2/sites-enabled/{{ item }} state=absent @@ -18,5 +16,4 @@ - 000-default - 000-default.conf notify: apache2 reload - tags: - - apache + tags: apache diff --git a/apache/tasks/main.yml b/apache/tasks/main.yml index 2c9a3c64..ce8c9d66 100644 --- a/apache/tasks/main.yml +++ b/apache/tasks/main.yml @@ -1,4 +1,5 @@ --- - include: apache.yml +- include: apache-modules.yml - include: apache-basic-auth.yml when: apache_basic_auth