From 9779792b0795f1800939a840a5a8a2b94aaf5322 Mon Sep 17 00:00:00 2001 From: Eike Frost Date: Fri, 10 Jul 2015 17:41:44 +0200 Subject: [PATCH] return as unchanged if macro update is unnecessary --- lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py b/lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py index 4f3eae881a..767e213db3 100644 --- a/lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py +++ b/lib/ansible/modules/extras/monitoring/zabbix_hostmacro.py @@ -147,6 +147,8 @@ class HostMacro(object): # update host macro def update_host_macro(self, host_macro_obj, macro_name, macro_value): host_macro_id = host_macro_obj['hostmacroid'] + if host_macro_obj['macro'] == '{$'+macro_name+'}' and host_macro_obj['value'] == macro_value: + self._module.exit_json(changed=False, result="Host macro %s already up to date" % macro_name) try: if self._module.check_mode: self._module.exit_json(changed=True)