From d7414d55e14a5c98e381a94f5c8a912afbe6355f Mon Sep 17 00:00:00 2001 From: Ricardo Leonardo Date: Sun, 15 Dec 2019 04:13:49 +0100 Subject: [PATCH] =?UTF-8?q?fixes=20bug:=20visible=5Fname=20was=20not=20upd?= =?UTF-8?q?ated=20when=20not=20set=20in=20existing=20host=E2=80=A6=20(#640?= =?UTF-8?q?95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixes bug: visible_name was not updated when not set in existing host in zabbix * Update changelogs/fragments/fix_zabbix_host_visible_name.yml Co-Authored-By: Dusan Matejka * Update lib/ansible/modules/monitoring/zabbix/zabbix_host.py Co-Authored-By: Dusan Matejka --- changelogs/fragments/fix_zabbix_host_visible_name.yml | 2 ++ lib/ansible/modules/monitoring/zabbix/zabbix_host.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/fix_zabbix_host_visible_name.yml diff --git a/changelogs/fragments/fix_zabbix_host_visible_name.yml b/changelogs/fragments/fix_zabbix_host_visible_name.yml new file mode 100644 index 00000000000..444f8b7d1f9 --- /dev/null +++ b/changelogs/fragments/fix_zabbix_host_visible_name.yml @@ -0,0 +1,2 @@ +bugfixes: + - zabbix_host - was not possible to update a host where visible_name was not set in zabbix diff --git a/lib/ansible/modules/monitoring/zabbix/zabbix_host.py b/lib/ansible/modules/monitoring/zabbix/zabbix_host.py index 4bf667af1ba..572dd15d5ce 100644 --- a/lib/ansible/modules/monitoring/zabbix/zabbix_host.py +++ b/lib/ansible/modules/monitoring/zabbix/zabbix_host.py @@ -533,7 +533,7 @@ class Host(object): # Check whether the visible_name has changed; Zabbix defaults to the technical hostname if not set. if visible_name: - if host['name'] != visible_name and host['name'] != host_name: + if host['name'] != visible_name: return True # Only compare description if it is given as a module parameter