Files
ansible-playbooks/roles/monitoring/tasks/validate.yml
T
DerLinkmanandDerLinkman a31751af1d Monitoring psk (#2)
Co-authored-by: DerLinkman <derlinkman@gmail.com>
Reviewed-on: #2
2026-07-18 19:37:52 +00:00

36 lines
1.5 KiB
YAML

---
- name: Stop playbook if system is not Debian
ansible.builtin.fail:
msg: "This role only supports Debian."
when: ansible_facts['os_family'] != "Debian"
- name: Ensure Zabbix passive servers are defined
ansible.builtin.assert:
that:
- monitoring_zabbix_passive_servers | length > 0
fail_msg: "Set monitoring_zabbix_passive_servers to the IPs, CIDRs or DNS names allowed to query the agent."
- name: Ensure Zabbix API settings are defined when host registration is enabled
ansible.builtin.assert:
that:
- monitoring_zabbix_api_url is defined
- monitoring_zabbix_api_url | length > 0
- monitoring_zabbix_api_user is defined
- monitoring_zabbix_api_user | length > 0
- monitoring_zabbix_api_password is defined
- monitoring_zabbix_api_password | length > 0
fail_msg: >-
monitoring_zabbix_api_url, monitoring_zabbix_api_user and
monitoring_zabbix_api_password must be set (password lives in vault.yml)
when monitoring_zabbix_register_host is true.
when: monitoring_zabbix_register_host | bool
- name: Ensure proxy address is set when a proxy is configured
ansible.builtin.assert:
that:
- monitoring_zabbix_proxy_address is defined
- monitoring_zabbix_proxy_address | length > 0
fail_msg: >-
monitoring_zabbix_proxy_address (IP/DNS of the proxy the agent contacts)
must be set when monitoring_zabbix_proxy is defined.
when: monitoring_zabbix_proxy | length > 0