noderings.cloud.dns_geo_record module – Manage geo-routed DNS records in a NodeRings zone

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_geo_record.

New in noderings.cloud 0.1.0

Synopsis

  • A geo-routed record answers differently depending on where the resolver is.

  • The most specific match wins, region before country before continent, and default answers everyone else.

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"

continents

dictionary

Answers by continent code (AF, AN, AS, EU, NA, OC, SA).

Default: {}

countries

dictionary

Answers by ISO 3166-1 alpha-2 country code, for example DE.

Default: {}

default

string

Answer for resolvers that match no other rule. Required when state=present.

name

string / required

Record name relative to the zone. Use @ for the apex.

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.

regions

dictionary

Answers by ISO 3166-2 subdivision such as US-CA, or a region group such as US-IX.

Default: {}

state

string

Whether the record should exist.

Choices:

  • "present" ← (default)

  • "absent"

ttl

integer

Time to live in seconds, 30 to 60.

Default: 60

type

string / required

Record type.

Choices:

  • "A"

  • "AAAA"

  • "CNAME"

  • "NAPTR"

  • "SRV"

validate_certs

boolean

Whether to validate the API’s TLS certificate.

Choices:

  • false

  • true ← (default)

zone

string

Name of the zone. Either zone or zone_id is required.

zone_id

string

ID of the zone.

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: Send Europe and North America to the nearest server
  noderings.cloud.dns_geo_record:
    zone: example.com
    name: app
    type: A
    default: 203.0.113.10
    continents:
      EU: 198.51.100.20
      NA: 203.0.113.10
    countries:
      JP: 192.0.2.30

Return Values

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

Key

Description

geo_record

dictionary

The record as stored. Empty after state=absent.

Returned: always

Authors

  • Shaygun (@shaygun)