From 277475be39d7107a7fc4aa52d8f4b995c4d79431 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Wed, 31 May 2023 22:05:56 +0200 Subject: [PATCH] added handlers + readme typo --- README.md | 2 +- defaults/main.yml | 1 + handlers/main.yml | 18 ++++++++++++++++++ tasks/configure.yml | 6 +++--- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 385d726..4592187 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Deplou AdGuard +Deploy AdGuard ========= > This repository is only a mirror. Development and testing is done on a private gitlab server. diff --git a/defaults/main.yml b/defaults/main.yml index 34871af..82f491a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -8,6 +8,7 @@ deploy_adguard_enable_doh: true deploy_adguard_enable_dot: false deploy_adguard_enable_doq: false deploy_adguard_enable_dnscrypt: false +deploy_adguard_start_service: false deploy_adguard_virtual_ip: enable: false interface: eth0 diff --git a/handlers/main.yml b/handlers/main.yml index c136e3e..f9e2c5a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,2 +1,20 @@ --- # handlers file for deploy_adguard +- name: "Reload systemd file" + ansible.builtin.systemd: + daemon_reload: true + listen: "systemctl-daemon-reload" + +- name: "Enable consul service" + ansible.builtin.service: + name: adguard + enabled: true + listen: "systemctl-enable-adguard" + +- name: "Start consul service" + ansible.builtin.service: + name: adguard + state: restarted + listen: "systemctl-restart-adguard" + throttle: 1 + when: deploy_adguard_start_service diff --git a/tasks/configure.yml b/tasks/configure.yml index 50e386d..e4b3dd6 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -8,7 +8,7 @@ group: root mode: '0644' notify: - - systemctl_daemon_reload + - systemctl-daemon-reload - name: "Copy docker-compose.yml template" ansible.builtin.template: @@ -18,7 +18,7 @@ group: root mode: '0600' notify: - - systemctl_restart_adguard + - systemctl-restart-adguard - name: "Copy AdGuardHome.yaml" ansible.builtin.template: @@ -29,4 +29,4 @@ mode: '0600' when: deploy_adguard_config is not empty notify: - - systemctl_restart_adguard + - systemctl-restart-adguard