ansible-collection-prometheus/roles/snmp_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

18 lines
435 B
YAML

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