From 3960153f70dee9060ee0aa646675850975647a2e Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Tue, 15 Dec 2020 20:49:52 +0100 Subject: [PATCH] fix so module `nios_host_record` can remove aliases (#1470) (#1490) * fix for https://github.com/ansible-collections/community.general/issues/1335 * added changelog fragment * Update changelogs/fragments/nios_host_record-fix-aliases-removal.yml Co-authored-by: Felix Fontein * extend changelog to specify CNAMES Co-authored-by: Felix Fontein (cherry picked from commit 496be77a2b07076e684f7dc9ff7f43aa0d73a276) Co-authored-by: Pablo Escobar Lopez --- changelogs/fragments/nios_host_record-fix-aliases-removal.yml | 3 +++ plugins/module_utils/net_tools/nios/api.py | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 changelogs/fragments/nios_host_record-fix-aliases-removal.yml diff --git a/changelogs/fragments/nios_host_record-fix-aliases-removal.yml b/changelogs/fragments/nios_host_record-fix-aliases-removal.yml new file mode 100644 index 0000000000..3003c78429 --- /dev/null +++ b/changelogs/fragments/nios_host_record-fix-aliases-removal.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - nios_host_record - fix to remove ``aliases`` (CNAMES) for configuration comparison (https://github.com/ansible-collections/community.general/issues/1335). diff --git a/plugins/module_utils/net_tools/nios/api.py b/plugins/module_utils/net_tools/nios/api.py index 7861d76c85..b01a54a400 100644 --- a/plugins/module_utils/net_tools/nios/api.py +++ b/plugins/module_utils/net_tools/nios/api.py @@ -455,6 +455,9 @@ class WapiModule(WapiBase): return False elif isinstance(proposed_item, list): + if key == 'aliases': + if set(current_item) != set(proposed_item): + return False for subitem in proposed_item: if not self.issubset(subitem, current_item): return False