apache role: manage the 'ports.conf' file.

This commit is contained in:
Andrea Dell'Amico 2018-10-29 11:49:29 +01:00
parent ab6ff75883
commit 5d9cdab42e
3 changed files with 11 additions and 15 deletions

View File

@ -6,6 +6,9 @@ apache_group: '{{ apache_user }}'
apache_from_ppa: False
apache_ppa_repo: 'ppa:ondrej/apache2'
apache_listen_ports:
- 80
# Possible choices: event, prefork (the old ones), worker (the threaded version), itm
apache_mpm_mode: worker

View File

@ -12,27 +12,17 @@
- is_trusty
tags: [ 'apache', 'apache_additional_packages' ]
# - name: Load the required worker module
# apache2_module: name={{ item.name }} state={{ item.state }} force=yes
# with_items: '{{ apache_worker_modules }}'
# when: is_trusty
# notify: apache2 restart
# ignore_errors: True
# tags: [ 'apache', 'apache_modules', 'apache_workers_modules' ]
# - 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: Install the apache additional packages, if any
apt: pkg={{ item }} state={{ apache_pkg_state }} update_cache=yes cache_valid_time=3600
with_items: '{{ apache_additional_packages_list }}'
when: apache_additional_packages
tags: [ 'apache', 'apache_additional_packages' ]
- name: Instal the ports conf file
template: src=ports.conf dest=/etc/apache2/ports.conf
notify: apache2 reload
tags: [ 'apache', 'apache_conf' ]
- name: Remove the default virtualhost file
file: dest=/etc/apache2/sites-enabled/{{ item }} state=absent
with_items:

View File

@ -0,0 +1,3 @@
{% for port in apache_listen_ports %}
Listen {{ port }}
{% endfor %}