From 7dd90cbe2fa4da3afce01527e8b52d6f167f0a1a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sun, 26 Feb 2023 18:49:55 +0100 Subject: [PATCH] Fix the metadata string --- defaults/main.yml | 1 + templates/zabbix_agentd.conf.j2 | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index dc91192..a3c49ab 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,6 +25,7 @@ zabbix_agent_start_agents: 3 zabbix_agent_passive_checks_status: 'disabled' zabbix_agent_hostname: '{{ ansible_fqdn }}' zabbix_agent_processing_timeout: 3 +zabbix_host_metadata: "{{ ansible_system }}" zabbix_agent_firewalld_services: - { service: 'zabbix-agent', state: '{{ zabbix_agent_passive_checks_status }}', zone: '{{ firewalld_default_zone }}' } diff --git a/templates/zabbix_agentd.conf.j2 b/templates/zabbix_agentd.conf.j2 index 3c9a012..a634543 100644 --- a/templates/zabbix_agentd.conf.j2 +++ b/templates/zabbix_agentd.conf.j2 @@ -183,11 +183,7 @@ Hostname={{ zabbix_agent_hostname }} # Range: 0-255 characters # Default: # HostMetadata= -{% if zabbix_authentication_method == "psk" %} -HostMetadata={{ ansible_system }} {{ zabbix_psk_string }} -{% else %} -HostMetadata={{ ansible_system }} -{% endif %} +HostMetadata={{ zabbix_host_metadata }} ### Option: HostMetadataItem # Optional parameter that defines an item used for getting host metadata.