Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix zone delegation, by allowing to specifiy record type == NS in rrsets array #162

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ for emergencies).

- Removed support for Python 3.8.

- Fix ability to make zone deligation
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Fix ability to make zone deligation
- Fix ability to make zone delegations


## [24.1.0] - 2024-02-09

### Changed
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/modules/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
Only used when O(properties.kind=Native), O(properties.kind=Master),
or O(properties.kind=Producer).
- Only used when zone is being created (O(state=present) and zone is not present).
- SOA and NS records are not permitted.
- SOA records are not permitted.
type: list
elements: dict
suboptions:
Expand Down Expand Up @@ -1438,7 +1438,7 @@ def main():

if props["rrsets"]:
for rrset in props["rrsets"]:
if rrset["type"] in ["SOA", "NS"]:
if rrset["type"] in ["SOA"]:
module.fail_json(
msg=(
f"'{rrset['type']}' type is not permitted in 'properties -> rrsets'"
Expand Down
8 changes: 4 additions & 4 deletions workflow-support/test-zone-rrset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
vars:
d1_rrset: "{{ lookup('dig_local', 't1.d1.rrset.example.', qtype='A', flat=0, fail_on_error=false, real_empty=false) }}"

- name: check for failure when rrset includes NS
- name: check zone creation with zone deligation
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: check zone creation with zone deligation
- name: check zone creation with zone delegation

kpfleming.powerdns_auth.zone:
<<: *common
name: d2.rrset.example.
Expand All @@ -59,18 +59,18 @@
mname: localhost.
rname: hostmaster.localhost.
rrsets:
- name: d2.rrset.example.
- name: sub.d2.rrset.example.
type: NS
records:
- content: ns1.invalid.
- content: ns2.example.
ignore_errors: true
register: result

- ansible.builtin.assert:
quiet: true
that:
- result['exception'] is not defined
- result.failed
- result.changed

- name: check for failure when rrset includes SOA
kpfleming.powerdns_auth.zone:
Expand Down