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

Fix zabbix_host for Zabbix Server versions < 3.0 (#38665)

The tls_* parameters are not present in Zabbix Server versions prior to
3.0. Thus the API response does not contain these keys and the
zabbix_host module failed. This commit adds checks if the parameters are
present in the API response and otherwise just completely ignores these
parameters. The documentation already states that they are not supported
for Zabbix Server versions below 3.0.
This commit is contained in:
Gaudenz Steinlin 2018-04-16 23:57:57 +02:00 committed by ansibot
parent 354aa8d602
commit 0ea7329553

View file

@ -509,27 +509,27 @@ class Host(object):
if proposed_inventory != host['inventory']: if proposed_inventory != host['inventory']:
return True return True
if tls_accept is not None: if tls_accept is not None and 'tls_accept' in host:
if int(host['tls_accept']) != tls_accept: if int(host['tls_accept']) != tls_accept:
return True return True
if tls_psk_identity is not None: if tls_psk_identity is not None and 'tls_psk_identity' in host:
if host['tls_psk_identity'] != tls_psk_identity: if host['tls_psk_identity'] != tls_psk_identity:
return True return True
if tls_psk is not None: if tls_psk is not None and 'tls_psk' in host:
if host['tls_psk'] != tls_psk: if host['tls_psk'] != tls_psk:
return True return True
if tls_issuer is not None: if tls_issuer is not None and 'tls_issuer' in host:
if host['tls_issuer'] != tls_issuer: if host['tls_issuer'] != tls_issuer:
return True return True
if tls_subject is not None: if tls_subject is not None and 'tls_subject' in host:
if host['tls_subject'] != tls_subject: if host['tls_subject'] != tls_subject:
return True return True
if tls_connect is not None: if tls_connect is not None and 'tls_connect' in host:
if int(host['tls_connect']) != tls_connect: if int(host['tls_connect']) != tls_connect:
return True return True
if ipmi_authtype is not None: if ipmi_authtype is not None: