diff --git a/apache/defaults/main.yml b/apache/defaults/main.yml index db86a937..4b405ec7 100644 --- a/apache/defaults/main.yml +++ b/apache/defaults/main.yml @@ -10,12 +10,14 @@ apache_mpm_mode: worker apache_packages: - apache2 - - 'apache2-mpm-{{ apache_mpm_mode }}' - apache2-utils - libapache2-mod-xsendfile - unzip - zip +apache_modules_packages: + - 'apache2-mpm-{{ apache_mpm_mode }}' + # Only one can be present at the same time. It needs to be listed as the last one apache_worker_modules: # - { name: 'mpm_itm', state: 'absent' } diff --git a/apache/tasks/apache.yml b/apache/tasks/apache.yml index 6e27018c..adaaab71 100644 --- a/apache/tasks/apache.yml +++ b/apache/tasks/apache.yml @@ -4,10 +4,10 @@ with_items: '{{ apache_packages }}' tags: [ 'apache', 'apache_main_packages' ] -- name: Install the apache additional packages, if any +- name: Install the apache modules packages apt: pkg={{ item }} state=installed - with_items: '{{ apache_additional_packages_list }}' - when: apache_additional_packages + with_items: '{{ apache_modules_packages }}' + when: not apache_from_ppa tags: [ 'apache', 'apache_additional_packages' ] # - name: Load the required worker module @@ -25,6 +25,12 @@ # ignore_errors: True # tags: [ 'apache', 'apache_modules' ] +- name: Install the apache additional packages, if any + apt: pkg={{ item }} state=installed + with_items: '{{ apache_additional_packages_list }}' + when: apache_additional_packages + tags: [ 'apache', 'apache_additional_packages' ] + - name: Remove the default virtualhost file file: dest=/etc/apache2/sites-enabled/{{ item }} state=absent with_items: