aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/linux_status/handlers/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/linux_status/handlers/main.yml')
-rw-r--r--roles/linux_status/handlers/main.yml15
1 files changed, 13 insertions, 2 deletions
diff --git a/roles/linux_status/handlers/main.yml b/roles/linux_status/handlers/main.yml
index 0ea529f..9c8b019 100644
--- a/roles/linux_status/handlers/main.yml
+++ b/roles/linux_status/handlers/main.yml
@@ -1,7 +1,18 @@
-- name: Restart linux-status
+- name: Collect service facts
+ ansible.builtin.service_facts:
+ listen: linux_status_configured
+
+- name: Reload systemd daemon
become: true
ansible.builtin.systemd_service:
daemon_reload: true
+ listen: linux_status_configured
+
+- name: Restart linux-status service
+ become: true
+ when: |
+ 'linux-status.service' in ansible_facts.services and ansible_facts.services['linux-status.service'].state == 'running'
+ ansible.builtin.systemd_service:
name: linux-status
state: restarted
- listen: linux_status_restart
+ listen: linux_status_configured