mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 11:53:12 +00:00
954a01d17c
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>
18 lines
435 B
YAML
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
|