From 0e60fc6eaf246e25146be49ad15723bba943f9df Mon Sep 17 00:00:00 2001 From: Greg Sutcliffe Date: Thu, 24 Apr 2025 17:21:21 +0100 Subject: [PATCH] Zabbix-stg: bump collection to 3.3.0 and re-enable user --- roles/ansible-server/files/requirements.yml | 2 +- .../zabbix_server/tasks/configure_api.yml | 52 +++++++++---------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/roles/ansible-server/files/requirements.yml b/roles/ansible-server/files/requirements.yml index 104ce1ed45..60a4061609 100644 --- a/roles/ansible-server/files/requirements.yml +++ b/roles/ansible-server/files/requirements.yml @@ -8,7 +8,7 @@ roles: collections: # Needed for Zabbix playbooks - name: community.zabbix - version: 3.0.0 + version: 3.3.0 # Needed for copr - name: amazon.aws version: 4.1.0 diff --git a/roles/zabbix/zabbix_server/tasks/configure_api.yml b/roles/zabbix/zabbix_server/tasks/configure_api.yml index d13dbdd33f..273c7062cc 100644 --- a/roles/zabbix/zabbix_server/tasks/configure_api.yml +++ b/roles/zabbix/zabbix_server/tasks/configure_api.yml @@ -65,33 +65,31 @@ - zabbix_configuration - zabbix_triggers -# Breaks on second run with community.zabbix < 3.3.0 -# See https://github.com/ansible-collections/community.zabbix/commit/8a962bfc046353db60a594ddc259fae396fc20a9 -# Revisit after freeze is over - don't delete the user or the next task will fail -# - name: Create a new Zabbix user for Matrix triggers -# community.zabbix.zabbix_user: -# username: matrix-bot -# name: Matrix -# surname: Bot -# usrgrps: -# - Zabbix administrators -# passwd: "{{ (env == 'staging') | ternary(zabbix_stg_botuser_pwd, zabbix_botuser_pwd) }}" -# user_medias: -# - mediatype: Matrix -# sendto: "{{ (env == 'staging') | ternary(zabbix_stg_matrix_roomid, zabbix_matrix_roomid) }}" -# period: 1-7,00:00-24:00 -# severity: -# not_classified: yes -# information: yes -# warning: yes -# average: yes -# high: yes -# disaster: yes -# active: yes -# state: present -# tags: -# - zabbix_configuration -# - zabbix_users + - name: Create a new Zabbix user for Matrix triggers + community.zabbix.zabbix_user: + username: matrix-bot + name: Matrix + surname: Bot + role_name: Super admin role # needed to allow notifications without lots of config around usergroups + usrgrps: + - Zabbix administrators + passwd: "{{ (env == 'staging') | ternary(zabbix_stg_botuser_pwd, zabbix_botuser_pwd) }}" + user_medias: + - mediatype: Matrix + sendto: "{{ (env == 'staging') | ternary(zabbix_stg_matrix_roomid, zabbix_matrix_roomid) }}" + period: 1-7,00:00-24:00 + severity: + not_classified: yes + information: yes + warning: yes + average: yes + high: yes + disaster: yes + active: yes + state: present + tags: + - zabbix_configuration + - zabbix_users - name: Send alerts to Matrix community.zabbix.zabbix_action: