From 59d15077418fe836abc2a55df9ae776e517fa91c Mon Sep 17 00:00:00 2001 From: Lucas Bickel <116588+hairmare@users.noreply.github.com> Date: Sat, 24 Feb 2024 02:49:45 +0100 Subject: [PATCH] fix(role::agent): radiorabe_zabbix_agent_extra_allow_key var instead of recursion (#15) --- roles/agent/README.md | 3 ++- roles/agent/defaults/main.yml | 2 ++ roles/agent/tasks/main.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/agent/README.md b/roles/agent/README.md index ea16a59..cec1288 100644 --- a/roles/agent/README.md +++ b/roles/agent/README.md @@ -12,7 +12,8 @@ Opinionated Zabbix agent installation | Variable | Default | | -------- | ------- | | `radiorabe_zabbix_agent_server` | `monitoring.service.int.rabe.ch` | -| `radiorabe_zabbix_agent_serveractive | `monitoring.service.int.rabe.ch` | +| `radiorabe_zabbix_agent_serveractive` | `monitoring.service.int.rabe.ch` | +| `radiorabe_zabbix_agent_extra_allow_key` | `[]`, the role add some defaults that are sane for our case | ### Other Variables diff --git a/roles/agent/defaults/main.yml b/roles/agent/defaults/main.yml index cc0c2f9..e1fbe27 100644 --- a/roles/agent/defaults/main.yml +++ b/roles/agent/defaults/main.yml @@ -1,5 +1,7 @@ radiorabe_zabbix_agent_server: monitoring.service.int.rabe.ch radiorabe_zabbix_agent_serveractive: monitoring.service.int.rabe.ch +radiorabe_zabbix_agent_extra_allow_key: [] + _radiorabe_zabbix_agent_package_name: zabbix-agent2 _radiorabe_zabbix_agent_package_state: present diff --git a/roles/agent/tasks/main.yaml b/roles/agent/tasks/main.yaml index db50935..e8bb320 100644 --- a/roles/agent/tasks/main.yaml +++ b/roles/agent/tasks/main.yaml @@ -37,7 +37,7 @@ zabbix_install_pip_packages: false # config zabbix_agent_dont_detect_ip: true - zabbix_agent2_allow_key: "{{ ( __radiorabe_zabbix_agent_allow_key + (zabbix_agent2_allow_key | default([]) ) | unique }}" + zabbix_agent2_allow_key: "{{ ( __radiorabe_zabbix_agent_allow_key + radiorabe_zabbix_agent_extra_allow_key ) | unique }}" # environment specific zabbix_agent2_server: "{{ radiorabe_zabbix_agent_server }}" zabbix_agent2_serveractive: "{{ radiorabe_zabbix_agent_serveractive }}"