zabbix: set releng_compose_stg zabbix_templates to empty list

add zabbix hostgroup create task

Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
David Kirwan 2024-02-12 13:53:54 +00:00
parent 1c2b21cfb6
commit bf5dcd8edb
No known key found for this signature in database
GPG key ID: A5893AB6474AC37D
5 changed files with 27 additions and 14 deletions

View file

@ -54,4 +54,6 @@ num_cpus: 16
primary_auth_source: ipa
virt_install_command: "{{ virt_install_command_two_nic_unsafe }}"
zabbix_templates:
- zabbix_templates/releng_compose_cronjobs.json
- "zabbix_templates/releng_compose_cronjobs.json"
zabbix_hostgroups:
- "fedora releng compose"

View file

@ -11,4 +11,5 @@ koji_weburl: "https://koji.stg.fedoraproject.org/koji"
mem_size: 8192
nfs_mount_opts: "rw,hard,bg,intr,noatime,nodev,nosuid,sec=sys,nfsvers=3"
num_cpus: 4
zabbix_templates: "{{ default([]) }}"
zabbix_templates: "{{ [] }}"
zabbix_hostgroups: "{{ [] }}"

View file

@ -0,0 +1,9 @@
---
- name: Create host groups
# set task level variables as we change ansible_connection plugin here
community.zabbix.zabbix_group:
state: present
host_groups: "{{ item }}"
with_items: "{{ zabbix_hostgroups }}" # Hostgroups specific to an ansible group can be overridden in inventory/group_vars/group_name
tags:
- zabbix_hostgroups

View file

@ -1,4 +1,17 @@
---
- name: Set API token
tags: always
set_fact:
ansible_zabbix_auth_key: "{{ (env == 'staging')|ternary(zabbix_stg_apikey, zabbix_apikey) }}"
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_host: "{{ (env == 'staging')|ternary(zabbix_stg_hostname, zabbix_hostname) }}"
ansible_zabbix_url_path: "" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
- include_tasks: templates.yml
tags:
- zabbix_templates

View file

@ -1,16 +1,4 @@
---
- name: Set API token
tags: always
set_fact:
ansible_zabbix_auth_key: "{{ (env == 'staging')|ternary(zabbix_stg_apikey, zabbix_apikey) }}"
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_host: "{{ (env == 'staging')|ternary(zabbix_stg_hostname, zabbix_hostname) }}"
ansible_zabbix_url_path: "" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
#- name: Get Zabbix template as JSON
# community.zabbix.zabbix_template_info:
# template_name: fedora releng compose cronjobs