From 816eee2c1e79c8f0f6ae07411bc0633e251119a3 Mon Sep 17 00:00:00 2001 From: Dusan Matejka Date: Tue, 23 Oct 2018 15:35:44 +0200 Subject: [PATCH] [2.7] zabbix_host: backport of #46521 (#47477) * zabbix_host: fix link template error (#46521) * add host interface before link template (cherry picked from commit 5a35907b714b2b597a3ad121a763933025a0ed29) * added changelog --- .../fragments/46521-zabbix_host-fix-link-template-error.yml | 2 ++ lib/ansible/modules/monitoring/zabbix/zabbix_host.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/46521-zabbix_host-fix-link-template-error.yml diff --git a/changelogs/fragments/46521-zabbix_host-fix-link-template-error.yml b/changelogs/fragments/46521-zabbix_host-fix-link-template-error.yml new file mode 100644 index 00000000000..38b5505141f --- /dev/null +++ b/changelogs/fragments/46521-zabbix_host-fix-link-template-error.yml @@ -0,0 +1,2 @@ +bugfixes: +- "zabbix_host - module was failing when zabbix host was updated with new interface and template depending on that interface at the same time" diff --git a/lib/ansible/modules/monitoring/zabbix/zabbix_host.py b/lib/ansible/modules/monitoring/zabbix/zabbix_host.py index a4d6258b9ff..2b4bfb9b420 100644 --- a/lib/ansible/modules/monitoring/zabbix/zabbix_host.py +++ b/lib/ansible/modules/monitoring/zabbix/zabbix_host.py @@ -814,12 +814,12 @@ def main(): description, host_name, inventory_mode, inventory_zabbix, tls_accept, tls_psk_identity, tls_psk, tls_issuer, tls_subject, tls_connect, ipmi_authtype, ipmi_privilege, ipmi_username, ipmi_password): - host.link_or_clear_template(host_id, template_ids, tls_connect, tls_accept, tls_psk_identity, - tls_psk, tls_issuer, tls_subject, ipmi_authtype, ipmi_privilege, - ipmi_username, ipmi_password) host.update_host(host_name, group_ids, status, host_id, interfaces, exist_interfaces, proxy_id, visible_name, description, tls_connect, tls_accept, tls_psk_identity, tls_psk, tls_issuer, tls_subject, ipmi_authtype, ipmi_privilege, ipmi_username, ipmi_password) + host.link_or_clear_template(host_id, template_ids, tls_connect, tls_accept, tls_psk_identity, + tls_psk, tls_issuer, tls_subject, ipmi_authtype, ipmi_privilege, + ipmi_username, ipmi_password) host.update_inventory_mode(host_id, inventory_mode) host.update_inventory_zabbix(host_id, inventory_zabbix)