diff --git a/changelogs/fragments/1788-ease-nios_host_record-dns-bypass-check.yml b/changelogs/fragments/1788-ease-nios_host_record-dns-bypass-check.yml new file mode 100644 index 0000000000..6b1a43cc25 --- /dev/null +++ b/changelogs/fragments/1788-ease-nios_host_record-dns-bypass-check.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - nios_host_record - allow DNS Bypass for views other than default (https://github.com/ansible-collections/community.general/issues/1786). diff --git a/plugins/module_utils/net_tools/nios/api.py b/plugins/module_utils/net_tools/nios/api.py index 6cded8e1c8..91dcbad564 100644 --- a/plugins/module_utils/net_tools/nios/api.py +++ b/plugins/module_utils/net_tools/nios/api.py @@ -251,13 +251,10 @@ class WapiModule(WapiBase): else: proposed_object[key] = self.module.params[key] - # If configure_by_dns is set to False, then delete the default dns set in the param else throw exception + # If configure_by_dns is set to False and view is 'default', then delete the default dns if not proposed_object.get('configure_for_dns') and proposed_object.get('view') == 'default'\ and ib_obj_type == NIOS_HOST_RECORD: del proposed_object['view'] - elif not proposed_object.get('configure_for_dns') and proposed_object.get('view') != 'default'\ - and ib_obj_type == NIOS_HOST_RECORD: - self.module.fail_json(msg='DNS Bypass is not allowed if DNS view is set other than \'default\'') if ib_obj_ref: if len(ib_obj_ref) > 1: