From c80d0c40ce107b0c1a3daea0308caa80003d1c01 Mon Sep 17 00:00:00 2001 From: Dusan Matejka Date: Mon, 10 Feb 2020 08:09:00 +0100 Subject: [PATCH] fixed zabbix no longer returning macros as part of the template (#66996) --- lib/ansible/modules/monitoring/zabbix/zabbix_template.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/monitoring/zabbix/zabbix_template.py b/lib/ansible/modules/monitoring/zabbix/zabbix_template.py index 35f466df6ae..7d743f06e1c 100644 --- a/lib/ansible/modules/monitoring/zabbix/zabbix_template.py +++ b/lib/ansible/modules/monitoring/zabbix/zabbix_template.py @@ -425,6 +425,9 @@ class Template(object): changed = True break + if 'macros' not in existing_template['zabbix_export']['templates'][0]: + existing_template['zabbix_export']['templates'][0]['macros'] = [] + if template_macros is not None: existing_macros = existing_template['zabbix_export']['templates'][0]['macros'] if template_macros != existing_macros: