Skip to content

Commit

Permalink
Allow zabbix_host to change proxy to no proxy, fixes ansible#24735 (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
D3DeFi authored and ansibot committed Oct 5, 2017
1 parent 13e89b1 commit 336723d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ansible/modules/monitoring/zabbix_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def update_host(self, host_name, group_ids, status, host_id, interfaces, exist_i
self._module.exit_json(changed=True)
parameters = {'hostid': host_id, 'groups': group_ids, 'status': status, 'tls_connect': tls_connect,
'tls_accept': tls_accept}
if proxy_id:
if proxy_id >= 0:
parameters['proxy_hostid'] = proxy_id
if visible_name:
parameters['name'] = visible_name
Expand Down Expand Up @@ -448,7 +448,7 @@ def check_all_properties(self, host_id, host_groups, status, interfaces, templat
if set(list(template_ids)) != set(exist_template_ids):
return True

if host['proxy_hostid'] != proxy_id:
if int(host['proxy_hostid']) != int(proxy_id):
return True

if host['name'] != visible_name:
Expand Down Expand Up @@ -602,7 +602,7 @@ def main():
if proxy:
proxy_id = host.get_proxyid_by_proxy_name(proxy)
else:
proxy_id = None
proxy_id = 0

# get host id by host name
zabbix_host_obj = host.get_host_by_host_name(host_name)
Expand Down

0 comments on commit 336723d

Please sign in to comment.