library/roles/apache: Provide a way to install additional apache modules packages.

This commit is contained in:
Andrea Dell'Amico 2016-01-26 19:51:14 +01:00
parent f38597a4a2
commit 96a58f5435
3 changed files with 18 additions and 10 deletions

View File

@ -51,6 +51,10 @@ apache_basic_auth_modules:
# apache_basic_users: # apache_basic_users:
# - { username:'', password:'', state:'present,absent', auth_file:'path_to_file' } # - { username:'', password:'', state:'present,absent', auth_file:'path_to_file' }
#
# apache_additional_packages:
# - libapache2-mod-uwsgi
# - ...
# #
# Set this variable to load the modules you need # Set this variable to load the modules you need
#apache_additional_modules: #apache_additional_modules:

View File

@ -1,19 +1,25 @@
--- ---
- name: Install the apache packages - name: Install the apache packages
apt: pkg={{ item }} state=installed force=yes apt: pkg={{ item }} state=installed force=yes
with_items: apache_packages with_items: '{{ apache_packages }}'
tags: [ 'apache', 'apache_main_packages' ] tags: [ 'apache', 'apache_main_packages' ]
- name: Install the apache additional packages, if any
apt: pkg={{ item }} state=installed force=yes
with_items: '{{ apache_additional_packages }}'
when: apache_additional_packages is defined
tags: [ 'apache', 'apache_additional_packages' ]
- name: Load the required worker module - name: Load the required worker module
apache2_module: name={{ item.name }} state={{ item.state }} apache2_module: name={{ item.name }} state={{ item.state }}
with_items: apache_worker_modules with_items: '{{ apache_worker_modules }}'
when: is_trusty when: is_trusty
notify: apache2 restart notify: apache2 restart
tags: [ 'apache', 'apache_modules', 'apache_workers_modules' ] tags: [ 'apache', 'apache_modules', 'apache_workers_modules' ]
- name: Load the required modules - name: Load the required modules
apache2_module: name={{ item }} state=present apache2_module: name={{ item }} state=present
with_items: apache_default_modules with_items: '{{ apache_default_modules }}'
notify: apache2 reload notify: apache2 reload
tags: [ 'apache', 'apache_modules' ] tags: [ 'apache', 'apache_modules' ]

View File

@ -4,15 +4,13 @@
with_items: with_items:
- postgresql-client - postgresql-client
when: tomcat_install_jdbc is defined and tomcat_install_jdbc when: tomcat_install_jdbc is defined and tomcat_install_jdbc
tags: tags: [ 'postgres', 'postgresql', 'tomcat' ]
- postgres
- postgresql
- name: Install the mongodb client - name: Install the mongodb client
apt: pkg={{ item }} state=installed apt: pkg={{ item }} state=installed
with_items: with_items:
- mongodb-clients - mongodb-clients
when: mongodb is not defined when:
tags: - mongodb is not defined
- mongodb - install_mongodb_client is defined and install_mongodb_client
tags: [ 'mongodb', 'tomcat' ]