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)

* 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>
This commit is contained in:
shieni 2021-02-15 09:29:04 +02:00 committed by GitHub
parent 1cce279424
commit 8fae693d9c
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

@ -260,13 +260,10 @@ class WapiModule(WapiBase):
else: else:
proposed_object[key] = self.module.params[key] 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'\ if not proposed_object.get('configure_for_dns') and proposed_object.get('view') == 'default'\
and ib_obj_type == NIOS_HOST_RECORD: and ib_obj_type == NIOS_HOST_RECORD:
del proposed_object['view'] 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 ib_obj_ref:
if len(ib_obj_ref) > 1: if len(ib_obj_ref) > 1: