ansible-collection-prometheus/roles/blackbox_exporter/handlers/main.yml
SuperQ 954a01d17c
fix: Don't reload services when restarting
Avoid triggering a reload of various role services when a restart is
needed. This avoids the race between restart and reload.

Signed-off-by: SuperQ <superq@gmail.com>
2024-01-29 13:57:34 +01:00

17 lines
443 B
YAML

---
- name: Restart blackbox_exporter
listen: "restart blackbox_exporter"
become: true
ansible.builtin.systemd:
daemon_reload: true
name: blackbox_exporter
state: restarted
register: blackbox_exporter_restarted
- name: Reload blackbox_exporter
listen: "reload blackbox_exporter"
become: true
ansible.builtin.systemd:
name: blackbox_exporter
state: reloaded
when: blackbox_exporter_restarted is not defined