mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-21 19:33:04 +00:00
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>
This commit is contained in:
parent
54232114d7
commit
954a01d17c
4 changed files with 16 additions and 8 deletions
|
@ -6,6 +6,7 @@
|
|||
daemon_reload: true
|
||||
name: alertmanager
|
||||
state: restarted
|
||||
register: alertmanager_restarted
|
||||
|
||||
- name: Reload alertmanager
|
||||
listen: "reload alertmanager"
|
||||
|
@ -13,3 +14,4 @@
|
|||
ansible.builtin.systemd:
|
||||
name: alertmanager
|
||||
state: reloaded
|
||||
when: alertmanager_restarted is not defined
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
daemon_reload: true
|
||||
name: blackbox_exporter
|
||||
state: restarted
|
||||
register: blackbox_exporter_restarted
|
||||
|
||||
- name: Reload blackbox_exporter
|
||||
listen: "reload blackbox_exporter"
|
||||
|
@ -13,3 +14,4 @@
|
|||
ansible.builtin.systemd:
|
||||
name: blackbox_exporter
|
||||
state: reloaded
|
||||
when: blackbox_exporter_restarted is not defined
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
daemon_reload: true
|
||||
name: prometheus
|
||||
state: restarted
|
||||
register: prometheus_restarted
|
||||
|
||||
- name: Reload prometheus
|
||||
listen: "reload prometheus"
|
||||
|
@ -13,3 +14,4 @@
|
|||
ansible.builtin.systemd:
|
||||
name: prometheus
|
||||
state: reloaded
|
||||
when: prometheus_restarted is not defined
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
---
|
||||
- name: Reload snmp_exporter
|
||||
listen: "reload snmp_exporter"
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: true
|
||||
name: snmp_exporter
|
||||
state: reloaded
|
||||
|
||||
- name: Restart snmp_exporter
|
||||
listen: "restart snmp_exporter"
|
||||
become: true
|
||||
|
@ -14,3 +6,13 @@
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue