kpfleming.powerdns_auth.rrset module – Manages an RRset in a zone of PowerDNS Authoritative server

Note

This module is part of the kpfleming.powerdns_auth collection (version 25.2.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.rrset.

Synopsis

  • This module can create, delete or update an RRset inside a zone of PowerDNS Authoritative server.

Requirements

The below requirements are needed on the host that executes this module.

  • bravado

Parameters

Parameter

Comments

A

list / elements=dictionary

RR of type A.

At least one RR type is required if state=present or state=absent and type is not present.

address

string / required

IPv4 address.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

AAAA

list / elements=dictionary

RR of type AAAA.

At least one RR type is required if state=present or state=absent and type is not present.

address

string / required

IPv6 address.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

api_key

string / required

Key (token) used to authenticate to the API endpoint in the server.

api_spec_path

string

Path of the OpenAPI (Swagger) API spec document in api_url.

Default: "/api/docs"

api_url

string

URL of the API endpoint in the server.

Default: "http://localhost:8081"

CAA

list / elements=dictionary

Certificate Authority Authorization RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

flags

integer

Critical flag for CAA record.

Choices:

  • 0 ← (default)

  • 1

tag

string / required

Property tag for CAA record.

Choices:

  • "issue"

  • "issuewild"

  • "iodef"

value

any / required

Property value for CAA record.

CNAME

list / elements=dictionary

Canonical name RR.

At least one RR type is required if state=present or state=absent and type is not present.

cname

string / required

Canonical domain name.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

DNSKEY

list / elements=dictionary

DNS Key RR for DNSSEC.

At least one RR type is required if state=present or state=absent and type is not present.

algorithm

integer / required

Algorithm used for the key.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

flags

integer / required

Key flags field.

Choices:

  • 256

  • 257

protocol

integer / required

Protocol field.

Choices:

  • 3

public_key

string / required

Base64 encoded public key.

DS

list / elements=dictionary

Delegation Signer RR for DNSSEC.

At least one RR type is required if state=present or state=absent and type is not present.

algorithm

integer / required

Algorithm used for signing.

digest

string / required

Digest value.

digest_type

integer / required

Digest algorithm type.

Choices:

  • 1

  • 2

  • 3

  • 4

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

key_tag

integer / required

Key tag field.

HINFO

list / elements=dictionary

Host information RR.

At least one RR type is required if state=present or state=absent and type is not present.

cpu

any / required

CPU type.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

os

any / required

Operating system.

HTTPS

list / elements=dictionary

HTTPS service binding RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

params

string

Service parameters.

priority

integer / required

Priority of the target host.

target

string / required

Target hostname.

keep

boolean

Whether or not to keep existing records.

Choices:

  • false ← (default)

  • true

LOC

list / elements=dictionary

Location RR.

At least one RR type is required if state=present or state=absent and type is not present.

altitude

string / required

Altitude coordinate.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

horizontal_precision

string

Horizontal precision.

Default: "10000.0m"

latitude

string / required

Latitude coordinate.

longitude

string / required

Longitude coordinate.

size

string

Size of the location.

Default: "1.0m"

vertical_precision

string

Vertical precision.

Default: "10.0m"

MX

list / elements=dictionary

Mail exchange RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

exchange

string / required

Mail server hostname.

preference

integer / required

Priority preference for mail delivery.

name

string

Name of the RRset

Required if state=present or state=absent

NAPTR

list / elements=dictionary

Name Authority Pointer RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

flags

any / required

Flags field.

order

integer / required

Order field for processing records.

preference

integer / required

Preference field for records with same order.

regexp

any / required

Regular expression for substitution.

replacement

string / required

Replacement domain name.

services

any / required

Services field.

NS

list / elements=dictionary

Name server RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

host

string / required

Name server hostname.

PTR

list / elements=dictionary

Pointer RR for reverse DNS lookup.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

ptrdname

string / required

Domain name for reverse lookup.

records

list / elements=dictionary

Represents a list of RRs.

Required if type and state=present.

content

string / required

The content of the RR.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

RP

list / elements=dictionary

Responsible person RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

mbox

string / required

Mailbox domain name of responsible person.

txt

string / required

Domain name for TXT record with contact info.

server_id

string

ID of the server instance which holds the key.

Default: "localhost"

SOA

list / elements=dictionary

Start of Authority RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

expire

integer

Expire time in seconds.

minimum

integer

Minimum TTL in seconds.

mname

string / required

Primary master name server.

refresh

integer

Refresh interval in seconds.

retry

integer

Retry interval in seconds.

rname

string / required

Email address of zone administrator.

serial

integer

Serial number of the zone.

SPF

list / elements=dictionary

Sender Policy Framework RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

strings

any / required

SPF policy strings.

SRV

list / elements=dictionary

Service RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

port

integer / required

TCP or UDP port number.

priority

integer / required

Priority of the target host.

target

string / required

Target hostname.

weight

integer / required

Relative weight for records with same priority.

SSHFP

list / elements=dictionary

SSH fingerprint RR.

At least one RR type is required if state=present or state=absent and type is not present.

algorithm

integer / required

SSH key algorithm.

Choices:

  • 1

  • 2

  • 3

  • 4

  • 6

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

fingerprint

string / required

SSH key fingerprint.

fp_type

integer / required

Fingerprint type.

Choices:

  • 1

  • 2

  • 3

state

string

If present the RRset will be created unless it already exists in which case if keep=false RRs will be replaced and if keep=true new RRs will be added.

If absent and keep=false the whole RRset will be deleted

If absent and keep=true only the matching RRs will be deleted

If exists a list of all RRsets in the zone will be returned

If exists and name and/or type existence will be checked and matching RRsets will be returned

Choices:

  • "present" ← (default)

  • "absent"

  • "exists"

SVCB

list / elements=dictionary

Service binding RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

params

string

Service parameters.

priority

integer / required

Priority of the target host.

target

string / required

Target hostname.

TLSA

list / elements=dictionary

Transport Layer Security Authentication RR.

At least one RR type is required if state=present or state=absent and type is not present.

cert_assoc_data

string / required

Certificate association data.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

matching_type

integer / required

Matching type.

Choices:

  • 0

  • 1

  • 2

selector

integer / required

Selector field.

Choices:

  • 0

  • 1

usage

integer / required

Certificate usage.

Choices:

  • 0

  • 1

  • 2

  • 3

ttl

integer

TTL of the records, in seconds.

Default: 3600

TXT

list / elements=dictionary

Text RR.

At least one RR type is required if state=present or state=absent and type is not present.

disabled

boolean

Whether or not this RR is disabled.

Choices:

  • false ← (default)

  • true

strings

any / required

Text strings.

type

string

Type of resource record (e.g. A, PTR…).

Required if state=absent or state=present and none of the RR type options are provided.

zone_name

string / required

Name of the zone

Examples

%YAML 1.2
---
- name: Creating an RRset of RR type A
  kpfleming.powerdns_auth.rrset:
    api_key: foo
    zone_name: zone.example.
    name: ns.zone.example.
    type: A
    records:
      - content: 192.168.0.1

- name: Creating an RRset of RR type A
  kpfleming.powerdns_auth.rrset:
    api_key: foo
    zone_name: zone.example.
    name: ns.zone.example.
    A:
      - address: 192.168.0.1

- name: Deleting an RRset
  kpfleming.powerdns_auth.rrset:
    api_key: foo
    zone_name: zone.example.
    name: ns.zone.example.
    type: A

- name: Replacing RR in an RRset
  kpfleming.powerdns_auth.rrset:
    api_key: foo
    zone_name: zone.example.
    name: ns.zone.example.
    A:
      - address: 192.168.1.1

- name: Adding RR to an RRset
  kpfleming.powerdns_auth.rrset:
    api_key: foo
    zone_name: zone.example.
    name: ns.zone.example.
    keep: true
    NS:
      - host: ns1.example.

- name: Deleting RR in RRset
  kpfleming.powerdns_auth.rrset:
    api_key: foo
    zone_name: zone.example.
    name: ns.zone.example.
    state: absent
    keep: true
    NS:
      - host: ns1.example.

- name: Listing all RRsets in a zone
  kpfleming.powerdns_auth.rrset:
    api_key: foo
    zone_name: zone.example.
    state: exists

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

exists

boolean

whether the provided name and type lead to existing RRset(s)

Returned: when state is exists and name and/or type provided

name

string

name of the RRset

Returned: always

Sample: "rrset.example."

rrsets

list / elements=dictionary

list of existing RRsets or RRsets after changes are made

Returned: always

comments

list / elements=string

list of comments on the RRset

Returned: success

name

string

name of the RRset

Returned: success

records

list / elements=string

RRs list

Returned: success

ttl

integer

TTL of the RRs, in seconds.

Returned: success

type

string

RR type

Returned: success

Authors

  • Mohamed Chamrouk (@mohamed-chamrouk)