41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
---
|
|
# handlers file for zabbix-agent
|
|
|
|
- name: restart zabbix-agent
|
|
ansible.builtin.service:
|
|
name: "{{ zabbix_agent_service }}"
|
|
state: restarted
|
|
enabled: true
|
|
become: true
|
|
when:
|
|
- not zabbix_agent_docker
|
|
- ansible_os_family != "Windows" and ansible_os_family != "Darwin"
|
|
|
|
- name: firewalld-reload
|
|
ansible.builtin.command: "firewall-cmd --reload"
|
|
become: true
|
|
when:
|
|
- ansible_facts.services["firewalld"] is defined
|
|
- ansible_facts.services["firewalld"].state == "running"
|
|
|
|
- name: restart win zabbix agent
|
|
win_service:
|
|
name: "{{ zabbix_win_svc_name }}"
|
|
state: restarted
|
|
when:
|
|
- ansible_os_family == "Windows"
|
|
|
|
- name: restart mac zabbix agent
|
|
ansible.builtin.command: "launchctl kickstart -k system/{{ zabbix_agent_service }}"
|
|
become: true
|
|
when:
|
|
- not zabbix_agent_docker
|
|
- ansible_os_family == "Darwin"
|
|
|
|
- name: "clean repo files from proxy creds"
|
|
ansible.builtin.shell: ls /etc/yum.repos.d/zabbix* && sed -i 's/^proxy =.*//' /etc/yum.repos.d/zabbix* || true
|
|
become: true
|
|
when:
|
|
- ansible_os_family == 'RedHat'
|
|
- zabbix_http_proxy is defined or zabbix_https_proxy is defined
|