---
# handlers file for zabbix-proxy

- name: restart zabbix-proxy
  ansible.builtin.service:
    name: zabbix-proxy
    state: restarted
    enabled: true
  become: true
  when:
    - zabbix_proxy_manage_service | bool

- 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
