kpfleming.powerdns_auth.zone module – Manages a zone in a PowerDNS Authoritative server
Note
This module is part of the kpfleming.powerdns_auth collection (version 24.3.0).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install kpfleming.powerdns_auth
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: kpfleming.powerdns_auth.zone
.
Synopsis
This module allows a task to manage the presence and configuration of a zone in a PowerDNS Authoritative server.
Requirements
The below requirements are needed on the host that executes this module.
bravado
Parameters
Parameter |
Comments |
---|---|
Key (token) used to authenticate to the API endpoint in the server. |
|
Path of the OpenAPI (Swagger) API spec document in Default: |
|
URL of the API endpoint in the server. Default: |
|
Zone metadata. Ignored when |
|
List of IPv4 and/or IPv6 subnets (or the special value AUTO-NS) from which AXFR requests will be accepted. |
|
List of IPv4 and/or IPv6 subnets from which DNSUPDATE requests will be accepted. |
|
List of IPv4 and/or IPv6 addresses (with optional port numbers) which will receive NOTIFY for updates. |
|
Rectify zone’s record sets after changes made through the API. Choices:
|
|
List of TSIG keys used to validate NOTIFY requests from zone masters and to sign AXFR/IXFR requests to zone masters. Note: only the first key in the list will be used. |
|
IPv4 or IPv6 address to be used as the source address for AXFR and IXFR requests. |
|
Forward DNSUPDATE requests to one of the zone’s masters. Choices:
|
|
Kerberos/GSS principal which identifies this server. |
|
Kerberos/GSS principal which must be included in AXFR requests. |
|
Attempt IXFR when retrieving zone updates. Choices:
|
|
Send a NOTIFY to all slave servers after processing a DNSUPDATE request. Choices:
|
|
Indicates that this zone operations in NSEC3 ‘narrow’ mode. Choices:
|
|
NSEC3 parameters for the zone when DNSSEC is used. |
|
Publish CDNSKEY records of the KSKs for the zone. Choices:
|
|
List of signature algorithm numbers for CDS records of the KSKs for the zone. |
|
Re-send NOTIFY to slaves after receiving AXFR from master. If this is not set, the ‘slave-renotify’ setting in the server configuration will be applied to the zone. Choices:
|
|
Method to update the serial number in the SOA record when serving it. Choices:
|
|
Method to update the serial number in the SOA record after an API edit. Choices:
|
|
Method to update the serial number in the SOA record after a DNSUPDATE. Choices:
|
|
List of TSIG keys used to sign NOTIFY requests and to validate AXFR/IXFR requests. Note: only the first key in the list will be used. |
|
List of TSIG keys for which DNSUPDATE requests will be accepted. |
|
Name of the zone to be managed. |
|
Zone properties. Ignored when |
|
Optional string used for local policy. |
|
Optional zone name, indicating that this zone should be a member of the specified catalog zone. Must be an absolute zone name (ending with ‘.’). Only supported in server version 4.7.0 or later. |
|
Zone kind.
Choices:
|
|
The id of the TSIG keys used for master operation in this zone. Only used when |
|
List of IPv4 or IPv6 addresses which are masters for this zone. Only used when |
|
List of nameserver names to be listed in NS records for zone. Only used when Only used when zone is being created ( Must be absolute names (ending with ‘.’). |
|
Resource Record Set. Only used when Only used when zone is being created ( SOA and NS records are not permitted. |
|
Name for record set (e.g. “www.powerdns.com.”). Must be absolute names (ending with ‘.’). |
|
Represents a list of records. |
|
The content of resource record. |
|
Whether or not this record is disabled. Choices:
|
|
TTL of the records, in seconds. Default: |
|
Type of resource record (e.g. “A”, “PTR”, “MX”). |
|
The id of the TSIG keys used for slave operation in this zone. Only used when |
|
SOA record fields. Only used when Only used when zone is being created ( |
|
Number of seconds after which secondary name servers should stop answering requests for this zone if the primary does not respond. Must be bigger than the sum of Default: |
|
DNS name (absolute, ending with ‘.’) of primary name server for the zone. |
|
Number of seconds after which secondary name servers should query the primary for the SOA record, to detect zone changes. Default: |
|
Number of seconds after which secondary name servers should retry to request the serial number from the primary if the primary does not respond. Must be less than Default: |
|
Email address of the ‘responsible party’ for the zone, formatted as a DNS name (absolute, ending with ‘.’). |
|
Initial serial number. Default: |
|
Time to live for purposes of negative caching. Default: |
|
Time to live for SOA and NS records. Only used when Only used when zone is being created ( Default: |
|
ID of the server instance which holds the key. Default: |
|
If If If If If If Choices:
|
Examples
%YAML 1.2
---
- name: check that zone exists
pdns_auth_zone:
name: d1.example.
state: exists
api_key: 'foobar'
- name: check that zone exists on a non-default server
pdns_auth_zone:
name: d1.example.
state: exists
api_key: 'foobar'
api_url: 'http://pdns.server.example:80'
- name: send NOTIFY to slave servers for zone
pdns_auth_zone:
name: d1.example.
state: notify
api_key: 'foobar'
- name: retrieve zone from master server
pdns_auth_zone:
name: d1.example.
state: retrieve
api_key: 'foobar'
- name: create native zone
pdns_auth_zone:
name: d2.example.
state: present
api_key: 'foobar'
properties:
kind: 'Native'
nameservers:
- 'ns1.example.'
soa:
mname: 'localhost.'
rname: 'hostmaster.localhost.'
metadata:
allow_axfr_from: ['AUTO-NS']
axfr_source: '127.0.0.1'
- name: change native zone to master
pdns_auth_zone:
name: d2.example.
state: present
api_key: 'foobar'
properties:
kind: 'Master'
- name: delete zone
pdns_auth_zone:
name: d2.example.
state: absent
api_key: 'foobar'
- name: create slave zone
pdns_auth_zone:
name: d3.example.
state: present
api_key: 'foobar'
properties:
kind: 'Slave'
masters:
- '1.1.1.1'
- '::1'
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Information about the zone Returned: always |
|
Account label Returned: always |
|
Name of catalog zone containing this zone Returned: when present |
|
Flag indicating whether zone is signed with DNSSEC Returned: when present |
|
Indicate whether the zone exists Returned: always |
|
Kind Returned: when present Can only return:
|
|
The id of the TSIG keys used for master operation in this zone. Returned: when present |
|
IP addresses of masters (only for Slave and Consumer zones) Returned: when present |
|
Zone metadata Returned: when present |
|
List of IPv4 and/or IPv6 subnets (or the special value AUTO-NS) from which AXFR requests will be accepted. Returned: success |
|
List of IPv4 and/or IPv6 subnets from which DNSUPDATE requests will be accepted. Returned: success |
|
List of IPv4 and/or IPv6 addresses (with optional port numbers) which will receive NOTIFY for updates. Returned: success |
|
Rectify zone’s record sets after changes made through the API. Returned: success |
|
List of TSIG keys used to validate NOTIFY requests from zone masters and to sign AXFR/IXFR requests to zone masters. Returned: success |
|
IPv4 or IPv6 address to be used as the source address for AXFR and IXFR requests. Returned: success |
|
Forward DNSUPDATE requests to one of the zone’s masters. Returned: success |
|
Kerberos/GSS principal which identifies this server. Returned: success |
|
Kerberos/GSS principal which must be included in AXFR requests. Returned: success |
|
Attempt IXFR when retrieving zone updates. Returned: success |
|
Script to be used to edit incoming AXFR requests; use ‘NONE’ to override a globally configured script. Returned: success |
|
Send a NOTIFY to all slave servers after processing a DNSUPDATE request. Returned: success |
|
Indicates that this zone operations in NSEC3 ‘narrow’ mode. Returned: success |
|
NSEC3 parameters for the zone when DNSSEC is used. Returned: success |
|
Indicates that this zone zone carries DNSSEC RRSIGs, and is presigned. Returned: success |
|
Publish CDNSKEY records of the KSKs for the zone. Returned: success |
|
List of signature algorithm numbers for CDS records of the KSKs for the zone. Returned: success |
|
Re-send NOTIFY to slaves after receiving AXFR from master. Returned: success |
|
Method to update the serial number in the SOA record when serving it. Returned: success Can only return:
|
|
Method to update the serial number in the SOA record after an API edit. Returned: success Can only return:
|
|
Method to update the serial number in the SOA record after a DNSUPDATE. Returned: success Can only return:
|
|
List of TSIG keys used to sign NOTIFY requests and to validate AXFR/IXFR requests. Returned: success |
|
List of TSIG keys for which DNSUPDATE requests will be accepted. Returned: success |
|
Name Returned: always |
|
Serial number from SOA record Returned: when present |
|
The id of the TSIG keys used for slave operation in this zone. Returned: when present |
Authors
Kevin P. Fleming (@kpfleming)