diff --git a/lib/ansible/modules/monitoring/zabbix/zabbix_host.py b/lib/ansible/modules/monitoring/zabbix/zabbix_host.py index 5922da5a2c1..f2ca94e124f 100644 --- a/lib/ansible/modules/monitoring/zabbix/zabbix_host.py +++ b/lib/ansible/modules/monitoring/zabbix/zabbix_host.py @@ -509,27 +509,27 @@ class Host(object): if proposed_inventory != host['inventory']: 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: 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: 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: 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: 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: 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: return True if ipmi_authtype is not None: