From fb90a9dee72436b7c4fdde9c23061ffb6db3ead5 Mon Sep 17 00:00:00 2001 From: ONODERA Masaru Date: Fri, 12 Jan 2024 12:07:56 +0000 Subject: [PATCH] Update changelog comment and modify module --- changelogs/fragments/1162-do_not_update_ipmi_options.yml | 2 +- plugins/modules/zabbix_host.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelogs/fragments/1162-do_not_update_ipmi_options.yml b/changelogs/fragments/1162-do_not_update_ipmi_options.yml index 745867b37..f85b7a77a 100644 --- a/changelogs/fragments/1162-do_not_update_ipmi_options.yml +++ b/changelogs/fragments/1162-do_not_update_ipmi_options.yml @@ -1,2 +1,2 @@ bugfixes: - - zabbix_host - Don't reset IPMI setting when update inventory + - zabbix_host - Don't reset IPMI setting when update inventory data of a host diff --git a/plugins/modules/zabbix_host.py b/plugins/modules/zabbix_host.py index 177a4ede4..d380a3736 100644 --- a/plugins/modules/zabbix_host.py +++ b/plugins/modules/zabbix_host.py @@ -541,9 +541,9 @@ def update_host(self, host_name, group_ids, status, host_id, interfaces, exist_i parameters["tls_subject"] = tls_subject if (description is not None and description != zabbix_host_obj["description"]): parameters["description"] = description - if ipmi_authtype: + if (ipmi_authtype is not None and ipmi_authtype != zabbix_host_obj["ipmi_authtype"]): parameters["ipmi_authtype"] = ipmi_authtype - if ipmi_privilege: + if (ipmi_privilege is not None and ipmi_privilege != zabbix_host_obj["ipmi_privilege"]): parameters["ipmi_privilege"] = ipmi_privilege if (ipmi_username is not None and ipmi_username != zabbix_host_obj["ipmi_username"]): parameters["ipmi_username"] = ipmi_username