From 87f8e7c17bac5cc5f1cf06870af64c94f1034252 Mon Sep 17 00:00:00 2001 From: ONODERA Masaru <46081939+masa-orca@users.noreply.github.com> Date: Sun, 4 Aug 2024 00:36:16 +0900 Subject: [PATCH 1/2] Change version of docker compose action (#1357) --- .github/workflows/plugins-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugins-integration.yml b/.github/workflows/plugins-integration.yml index 6e4818fa9..20738ca7c 100644 --- a/.github/workflows/plugins-integration.yml +++ b/.github/workflows/plugins-integration.yml @@ -68,7 +68,7 @@ jobs: # the Zabbix server. To do this we spin up a Docker container using the `matrix` # of version and ports specified earlier. - name: Zabbix container server provisioning - uses: isbang/compose-action@v1.5.0 + uses: hoverkraft-tech/compose-action@v2.0.1 with: compose-file: "./ansible_collections/community/zabbix/docker-compose.yml" env: From 197847338601732ce80d7c0c840536e5fca667aa Mon Sep 17 00:00:00 2001 From: ONODERA Masaru <46081939+masa-orca@users.noreply.github.com> Date: Sun, 4 Aug 2024 01:29:58 +0900 Subject: [PATCH 2/2] Delete denied parameters from host interfaces (#1356) --- ...6-zabbix_host-delete-denied-parameters.yml | 2 ++ plugins/modules/zabbix_host.py | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/1356-zabbix_host-delete-denied-parameters.yml diff --git a/changelogs/fragments/1356-zabbix_host-delete-denied-parameters.yml b/changelogs/fragments/1356-zabbix_host-delete-denied-parameters.yml new file mode 100644 index 000000000..8b804925d --- /dev/null +++ b/changelogs/fragments/1356-zabbix_host-delete-denied-parameters.yml @@ -0,0 +1,2 @@ +bugfixes: + - zabbix_host - delete denied parameter from interfaces diff --git a/plugins/modules/zabbix_host.py b/plugins/modules/zabbix_host.py index bdf010aba..b423d4260 100644 --- a/plugins/modules/zabbix_host.py +++ b/plugins/modules/zabbix_host.py @@ -966,9 +966,28 @@ def update_exist_interfaces_with_defaults(exist_interfaces): "privprotocol": 0, "privpassphrase": "" } + allowed_fields = [ + 'hostid', + 'type', + 'ip', + 'dns', + 'port', + 'useip', + 'main', + 'details', + 'interface_ref', + 'items', + 'interfaceid' + ] for interface in exist_interfaces: + normalized_interface = interface + denied_fields = list(set(interface.keys()) - set(allowed_fields)) + normalized_interface = zabbix_utils.helper_normalize_data( + interface, del_keys=denied_fields + )[0] + new_interface = default_interface.copy() - new_interface.update(interface) + new_interface.update(normalized_interface) new_interface["details"] = default_interface_details.copy() if "details" in interface: new_interface["details"].update(interface["details"])