Fix #719 by restarting services

This commit is contained in:
meaz 2023-12-16 18:35:09 +01:00
parent 29a0c887a3
commit 3098f4cbea
Signed by: meaz
GPG key ID: CD7A47B2F1ED43B4
2 changed files with 7 additions and 0 deletions

View file

@ -24,6 +24,8 @@
force: 'yes' force: 'yes'
version: '{{ zabbix_scripts_version }}' version: '{{ zabbix_scripts_version }}'
when: zabbix_scripts_deploy == 'true' when: zabbix_scripts_deploy == 'true'
notify:
- restart zabbix_agent
- name: '[Agent] - Ensure config dir path exists' - name: '[Agent] - Ensure config dir path exists'
file: file:
@ -36,6 +38,8 @@
src: 'zabbix-scripts.cfg.j2' src: 'zabbix-scripts.cfg.j2'
dest: '/var/local/container-scripts/zabbix-scripts.cfg' dest: '/var/local/container-scripts/zabbix-scripts.cfg'
when: zabbix_scripts_deploy == 'true' when: zabbix_scripts_deploy == 'true'
notify:
- restart zabbix_agent
- name: "[Agent] - Make sure the service is enabled" - name: "[Agent] - Make sure the service is enabled"
systemd: systemd:

View file

@ -11,6 +11,7 @@
state: stopped state: stopped
when: installed_version.stdout != zabbix_version when: installed_version.stdout != zabbix_version
ignore_errors: true # needed otherwise there is an error on first installation as it doesn't exist ignore_errors: true # needed otherwise there is an error on first installation as it doesn't exist
notify: restart zabbix_server
- name: "[Update] - Make sure the agent is stopped" - name: "[Update] - Make sure the agent is stopped"
systemd: systemd:
@ -18,6 +19,7 @@
state: stopped state: stopped
when: installed_version != zabbix_version when: installed_version != zabbix_version
ignore_errors: true # needed otherwise there is an error on first installation as it doesn't exist ignore_errors: true # needed otherwise there is an error on first installation as it doesn't exist
notify: restart zabbix_agent
- name: "[Update] - Make sure the proxy is stopped" - name: "[Update] - Make sure the proxy is stopped"
systemd: systemd:
@ -25,6 +27,7 @@
state: stopped state: stopped
when: installed_version != zabbix_version when: installed_version != zabbix_version
ignore_errors: true # needed otherwise there is an error on first installation as it doesn't exist ignore_errors: true # needed otherwise there is an error on first installation as it doesn't exist
notify: restart zabbix_proxy
- name: '[Update] - Remove current repository' - name: '[Update] - Remove current repository'
file: file: