diff --git a/tasks/configure.yml b/tasks/configure.yml index 2f13772..348b040 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -78,8 +78,15 @@ force: True name: "{{ item }}" with_items: "{{ apache_modules }}" + register: enabled_mods when: apache_modules is defined +- name: Ensure Apache is restarted after enabling modules + service: + name: apache2 + state: restarted + when: enabled_mods.changed + - name: Ensure vhost docroot exists file: path: "{{ item.docroot | default('/var/www/{{ item.vhostname }}') }}"