From a167d225f01c93bf743e39e0fd9a5fe81e70cb56 Mon Sep 17 00:00:00 2001 From: SebClem Date: Fri, 21 Jul 2023 13:53:45 +0200 Subject: [PATCH] Add handler to restart apache --- handlers/main.yml | 5 +++++ tasks/install.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/handlers/main.yml b/handlers/main.yml index 33c5f79..c01944d 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,2 +1,7 @@ --- # handlers file for Ansible-Dolibarr-Role + +- name: Restart Apache + ansible.builtin.service: + name: apache2 + state: restarted diff --git a/tasks/install.yml b/tasks/install.yml index 61ad1e9..0346953 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -15,26 +15,31 @@ group: "www-data" extra_opts: - --strip-components=1 + notify: Restart Apache - name: Enable apache modules community.general.apache2_module: name: "{{ item }}" state: present loop: "{{ dolibarr_apache_modules }}" + notify: Restart Apache - name: Add dolibarr apache site ansible.builtin.template: src: dolibarr.conf.j2 dest: /etc/apache2/sites-available/dolibarr.conf mode: "644" + notify: Restart Apache - name: Disable default site ansible.builtin.file: path: "/etc/apache2/sites-enabled/000-default.conf" state: absent + notify: Restart Apache - name: Enable dolibarr site ansible.builtin.file: path: "/etc/apache2/sites-enabled/dolibarr.conf" src: "/etc/apache2/sites-available/dolibarr.conf" state: link + notify: Restart Apache