From 66defc189e2a25e2c73ccc66c8465c7b345452aa Mon Sep 17 00:00:00 2001 From: David Kirwan Date: May 16 2024 08:22:21 +0000 Subject: zabbix: attach monitoring template to rabbitmq Signed-off-by: David Kirwan --- diff --git a/inventory/group_vars/proxies b/inventory/group_vars/proxies index 4da8218..350a2c2 100644 --- a/inventory/group_vars/proxies +++ b/inventory/group_vars/proxies @@ -85,4 +85,5 @@ varnish_group: proxies zabbix_templates: - group: "proxies" # Ansible group template: "external_hosts_http.json" # Template name in roles/zabbix/zabbix_templates/files/templatename.json + custom_template: true # Is the template official template bundled with Zabbix or one of our custom templates hostgroup: "fedora external hosts" # Zabbix hostgroup diff --git a/inventory/group_vars/rabbitmq b/inventory/group_vars/rabbitmq index e33a616..4a7a7fd 100644 --- a/inventory/group_vars/rabbitmq +++ b/inventory/group_vars/rabbitmq @@ -23,3 +23,8 @@ tcp_ports: [ # HTTP API #15672, ] +zabbix_templates: + - group: "rabbitmq" # Ansible group + template: "RabbitMQ node by Zabbix agent" # Template name in roles/zabbix/zabbix_templates/files/templatename.json + custom_template: false # Is the template official template bundled with Zabbix or one of our custom templates + hostgroup: "fedora rabbitmq" # Zabbix hostgroup diff --git a/inventory/group_vars/rabbitmq_stg b/inventory/group_vars/rabbitmq_stg index d2bac3e..dbbac46 100644 --- a/inventory/group_vars/rabbitmq_stg +++ b/inventory/group_vars/rabbitmq_stg @@ -30,3 +30,8 @@ tcp_ports: [ # HTTP API #15672, ] +zabbix_templates: + - group: "rabbitmq_stg" # Ansible group + template: "RabbitMQ node by Zabbix agent" # Template name in roles/zabbix/zabbix_templates/files/templatename.json + custom_template: false # Is the template official template bundled with Zabbix or one of our custom templates + hostgroup: "fedora rabbitmq" # Zabbix hostgroup diff --git a/inventory/group_vars/releng_compose b/inventory/group_vars/releng_compose index 5591142..0ee5446 100644 --- a/inventory/group_vars/releng_compose +++ b/inventory/group_vars/releng_compose @@ -56,4 +56,5 @@ virt_install_command: "{{ virt_install_command_two_nic_unsafe }}" zabbix_templates: - group: "releng_compose" template: "releng_compose_cronjobs.json" + custom_template: true # Is the template official template bundled with Zabbix or one of our custom templates hostgroup: "fedora releng compose" diff --git a/roles/zabbix/zabbix_templates/tasks/templates.yml b/roles/zabbix/zabbix_templates/tasks/templates.yml index 2f21598..a2a7728 100644 --- a/roles/zabbix/zabbix_templates/tasks/templates.yml +++ b/roles/zabbix/zabbix_templates/tasks/templates.yml @@ -17,6 +17,7 @@ template_json: "{{ lookup('file', item['template'] ) }}" state: present with_items: "{{ zabbix_templates }}" # Templates specific to an ansible group, can be overwridden in inventory/group_vars/group_name + when: "{{ item['custom_template'] }}" tags: - zabbix_add_templates - zabbix_templates