From 94fa012ab00d4c8f1931327f6198576894d39c5a Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 5 Jun 2025 14:57:00 +0200 Subject: [PATCH] updated zabbix state --- states/zabbix/defaults.yaml | 4 +++- states/zabbix/templates/zabbix_agent2.conf.j2 | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/states/zabbix/defaults.yaml b/states/zabbix/defaults.yaml index 2af204b..09180bc 100644 --- a/states/zabbix/defaults.yaml +++ b/states/zabbix/defaults.yaml @@ -36,7 +36,9 @@ zabbix: ForceActiveChecksOnStart: 1 PersistentBufferFile: /var/lib/zabbix/buffer.sqlite3 Hostname: localhost - Include: "/etc/zabbix/zabbix_agent2.d/*.conf" + Include: + - "/etc/zabbix/zabbix_agent2.d/*.conf" + - "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf" LogFile: /var/log/zabbix/zabbix_agent2.log LogFileSize: 0 LogType: file diff --git a/states/zabbix/templates/zabbix_agent2.conf.j2 b/states/zabbix/templates/zabbix_agent2.conf.j2 index 0c30637..9e9f46a 100644 --- a/states/zabbix/templates/zabbix_agent2.conf.j2 +++ b/states/zabbix/templates/zabbix_agent2.conf.j2 @@ -1,4 +1,10 @@ {%- from "zabbix/map.jinja" import zabbix with context -%} -{%- for key, value in zabbix.agent2.config.items() %} +{%- for key, value in zabbix.agent2.config.items() -%} +{%- if value is sequence and value is not mapping and value is not string -%} +{%- for v in value %} +{{ key }}={{ v }} +{%- endfor -%} +{%- else %} {{ key }}={{ value }} +{%- endif %} {%- endfor -%} \ No newline at end of file