1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

ease limitation for nios_host_record DNS Bypass (#1788) (#1825)

* ease limitation for nios_host_record DNS Bypass, the bypass should be allowed when configure_dns is disabled and view is set other than default

* add changelog fragment

Co-authored-by: Nils <ext-nils.haglund@elisa.fi>
(cherry picked from commit 8fae693d9c)

Co-authored-by: shieni <shieni@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-02-15 09:04:50 +01:00 committed by GitHub
parent 4080929c8a
commit 767e9076a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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).

View file

@ -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: