1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Allow zabbix_host to change proxy to no proxy, fixes #24735 (#29123)

This commit is contained in:
Dusan Matejka 2017-10-05 23:51:37 +02:00 committed by ansibot
parent 13e89b17cc
commit 336723d293

View file

@ -300,7 +300,7 @@ class Host(object):
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
@ -448,7 +448,7 @@ class Host(object):
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:
@ -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)