noderings.cloud.dns_zone module – Manage NodeRings DNS zones and DNSSEC

Note

This module is part of the noderings.cloud collection (version 0.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 noderings.cloud. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: noderings.cloud.dns_zone.

New in noderings.cloud 0.1.0

Synopsis

  • Creates or deletes a hosted DNS zone, and turns DNSSEC signing on or off.

  • After creating a zone, point your domain’s nameservers at the assigned_nameservers of zone at your registrar.

Requirements

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

  • python >= 3.9

Parameters

Parameter

Comments

api_retries

integer

How many times a request is retried after rate limiting (HTTP 429) or a gateway error (HTTP 502, 503 or 504).

Orders (virtual machines, game servers, snapshots) are never retried blindly.

Default: 5

api_timeout

integer

Timeout in seconds for a single HTTP request.

Default: 60

api_token

aliases: token

string

A NodeRings service-account token.

Create one in the NodeRings console under Organization > Service accounts.

If not set, the value of the NODERINGS_TOKEN, NODERINGS_API_TOKEN or NR_API_TOKEN environment variable is used.

api_url

string

Base URL of the NodeRings API.

If not set, the value of the NODERINGS_API_URL environment variable is used.

Default: "https://api.noderings.com"

check_delegation

boolean

Ask the API to re-check whether the domain is delegated to NodeRings nameservers, and return the result.

Choices:

  • false ← (default)

  • true

dnssec

boolean

true signs the zone, false stops signing. Leave unset to not manage DNSSEC.

After turning it on, publish dnssec.ds at your registrar.

Choices:

  • false

  • true

dnssec_force_disable

boolean

Stop signing even while the DS record is still published at the parent. This breaks resolution for validating resolvers until the DS is removed, so remove the DS at the registrar first.

Choices:

  • false ← (default)

  • true

force

boolean

With state=absent, delete the zone even while DNSSEC is active and the parent zone still publishes the DS record. That breaks resolution for validating resolvers until the DS is removed, so remove the DS at the registrar first.

Records in the zone are always deleted with it.

Choices:

  • false ← (default)

  • true

name

string / required

The domain, for example example.com. A trailing dot and upper case are ignored.

organization_id

string

Organization to act in, sent as the X-Organization-ID header.

Defaults to the organization the token belongs to.

If not set, the value of the NODERINGS_ORGANIZATION_ID or NR_ORGANIZATION_ID environment variable is used.

state

string

Whether the zone should exist.

Choices:

  • "present" ← (default)

  • "absent"

validate_certs

boolean

Whether to validate the API’s TLS certificate.

Choices:

  • false

  • true ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying the target.

diff_mode

Support: full

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Notes

Note

  • All modules in this collection belong to the noderings.cloud.noderings action group, so connection options can be set once with module_defaults.

Examples

- name: Host example.com on NodeRings DNS with DNSSEC
  noderings.cloud.dns_zone:
    name: example.com
    dnssec: true
  register: zone

- name: Show what to set at the registrar
  ansible.builtin.debug:
    msg:
      - "Nameservers: {{ zone.zone.assigned_nameservers | join(', ') }}"
      - "DS record: {{ zone.dnssec.ds }}"

- name: Delete a zone and all its records
  noderings.cloud.dns_zone:
    name: old-example.com
    state: absent

Return Values

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

Key

Description

dnssec

dictionary

DNSSEC state of the zone. Returned when dnssec is set.

Returned: when dnssec is set and state=present

algorithm

string

Signing algorithm.

Returned: success

dnskey

string

The zone’s public key.

Returned: success

ds

string

The DS record to publish at the registrar.

Returned: success

ds_at_parent

boolean

Whether the DS was found at the parent zone.

Returned: success

key_tag

integer

Key tag of the signing key.

Returned: success

mode

string

unsigned, signed_ds_pending until the DS is seen at the parent, then signed_active.

Returned: success

zone

dictionary

The zone. Empty after state=absent.

Returned: always

Sample: {"assigned_nameservers": ["ns1.example.net", "ns2.example.net"], "delegation_ok": false, "dnssec_mode": "DNSSEC_MODE_UNSIGNED", "id": "0f3c7b9e-1111-4c4c-8a8a-123456789abc", "name": "example.com", "state": "ZONE_STATE_ACTIVE"}

Authors

  • Shaygun (@shaygun)