Files
fedora-infra_ansible/playbooks/zabbix_maintenance.yml
Greg Sutcliffe 0e0b5f92c6 Zabbix: add shush/ok scripts and playbook
Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
2026-01-21 17:00:06 +00:00

42 lines
1.3 KiB
YAML

---
# Zabbix Maintenance Window Playbook
# Usage:
# ansible-playbook zabbix_maintenance.yml -e "state=present"
# ansible-playbook zabbix_maintenance.yml -e "state=absent"
- name: Manage Zabbix maintenance window
hosts: zabbix_stg:zabbix
gather_facts: false
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
vars:
ansible_zabbix_auth_key: "{{ zabbix_auth_key }}"
ansible_network_os: "{{ zabbix_network_os }}"
ansible_connection: "{{ zabbix_connection }}"
ansible_httpapi_port: "{{ zabbix_httpapi_port }}"
ansible_httpapi_use_ssl: "{{ zabbix_httpapi_use_ssl }}"
ansible_httpapi_validate_certs: "{{ zabbix_httpapi_validate_certs }}"
ansible_host: "{{ zabbix_server }}"
ansible_zabbix_url_path: "{{ zabbix_url_path }}"
state: "present" # present or absent
maintenance_name: Manual shush window
# Choose ONE of these target methods:
# Option 1: Target hostgroups
target_hostgroups:
- "All servers"
tasks:
- name: Create/remove maintenance window
community.zabbix.zabbix_maintenance:
name: "{{ maintenance_name }}"
host_groups: "{{ target_hostgroups }}"
state: "{{ state }}"
minutes: 1440
collect_data: true