From 99af482bea077ce974046dd98f327f05cdfdff9e Mon Sep 17 00:00:00 2001
From: Hinrikus Wolf <hinrikus@fsmpi.rwth-aachen.de>
Date: Thu, 3 Dec 2020 22:45:26 +0100
Subject: [PATCH] zabbix-agent: add switch for external repo since they package
 zabbix differently than debian

---
 zabbix-agent/templates/zabbix_agentd.conf.j2 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/zabbix-agent/templates/zabbix_agentd.conf.j2 b/zabbix-agent/templates/zabbix_agentd.conf.j2
index ae3829d..e0e92e1 100644
--- a/zabbix-agent/templates/zabbix_agentd.conf.j2
+++ b/zabbix-agent/templates/zabbix_agentd.conf.j2
@@ -70,7 +70,12 @@ LogFileSize=0
 #
 # Mandatory: no
 # Default:
+
+{% if zabbix_version is version("5.0", ">=") %}
+AllowKey=system.run[*]
+{% else %}
 EnableRemoteCommands=1
+{% endif %}
 
 ### Option: LogRemoteCommands
 #	Enable logging of executed shell commands as warnings.
@@ -262,7 +267,7 @@ Hostname={{ ansible_fqdn }}
 # Default:
 # Include=
 
-{% if ansible_distribution_major_version is version("10", ">=") %}
+{% if not zabbix_external_repo %}
 Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf
 {% else %}
 Include=/etc/zabbix/zabbix_agentd.d/*.conf
-- 
GitLab