Add support for variant zones creation#179
Conversation
src/plugins/modules/zone.py
Outdated
| zone_struct["nameservers"] = [] | ||
|
|
||
| # If zone is a variant name, use the cannonical name in the records. | ||
| zone_canonical = zone.split('..')[0] + '.' if '..' in zone else zone |
There was a problem hiding this comment.
This should work fine for now; I've got a large branch that I've been slowly working on which will use dnspython to properly canonicalize DNS names in this collection, so it will be interesting to see how that interacts when I get to work on it again.
There was a problem hiding this comment.
Please also run tox -elint locally to ensure that all the linter and other checks pass before updating the PR branch.
| # supply an empty nameserver list since NS records will be supplied in the rrsets | ||
| zone_struct["nameservers"] = [] | ||
|
|
||
| # If zone is a variant name, use the cannonical name in the records. |
There was a problem hiding this comment.
# If zone is a variant name, use the canonical name in the records.
| - not result.failed | ||
| - result.changed | ||
|
|
||
| - name: check "Variant" zone creation |
There was a problem hiding this comment.
We'll have to find a way to only run these tests when the pdns-auth version is 5.0 or higher. That will require some thought.
There was a problem hiding this comment.
I've added a check on the variable pdns_version which comes from the environment of the ci toolchain. However, I'm realizing that the backend used in the tests is sqlite, which doesn't support variant zones. This would also requires using LMDB.
6b20aed to
51dc95c
Compare
Fixes #178 by canonicalized zone name in SOA/NS records.