summaryrefslogtreecommitdiff
path: root/monitoring/zabbix_hostmacro.py
diff options
context:
space:
mode:
authorEike Frost <ei@kefro.st>2015-07-10 17:41:44 +0200
committerEike Frost <ei@kefro.st>2016-02-25 01:52:34 +0100
commit2a750bb8db9b79bb073d90c297b21aacf3cf8e85 (patch)
tree589b5dfa646b7513cc6ceaaa6a0f350567d31fd9 /monitoring/zabbix_hostmacro.py
parentfade5b7936342bd289e20da7413617780bb330b6 (diff)
downloadansible-modules-extras-2a750bb8db9b79bb073d90c297b21aacf3cf8e85.tar.gz
return as unchanged if macro update is unnecessary
Diffstat (limited to 'monitoring/zabbix_hostmacro.py')
-rw-r--r--monitoring/zabbix_hostmacro.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/monitoring/zabbix_hostmacro.py b/monitoring/zabbix_hostmacro.py
index e8d65370..3b66d456 100644
--- a/monitoring/zabbix_hostmacro.py
+++ b/monitoring/zabbix_hostmacro.py
@@ -149,6 +149,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)