diff --git a/defaults/main.yml b/defaults/main.yml index 66a5d7a..b56604b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,4 +11,5 @@ common__nginx__upstreams: [] common__nginx__sites: [] common__apache__remove_default: true +common__apache__modules: ['php7.3', 'rewrite', 'ssl'] common__apache__sites: [] diff --git a/tasks/apache.yml b/tasks/apache.yml index eff4167..1226f81 100644 --- a/tasks/apache.yml +++ b/tasks/apache.yml @@ -29,6 +29,14 @@ when: common__apache__remove_default|bool notify: common | Restart Apache +- name: Enable Apache modules + command: '/usr/sbin/a2enmod "{{ item }}"' + register: common__apache__enable_apache_modules_result + changed_when: > + common__apache__enable_apache_modules_result.stdout is search('Enabling module') + with_items: '{{ common__apache__modules }}' + notify: common | Restart Apache + - name: Add Apache sites template: src: 'templates/apache/{{ item.type }}.conf'