ansible-collection-prometheus/roles/prometheus/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
387 B
YAML

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