damex.incus.incus_network_zone_record module – Ensure Incus network zone record

Note

This module is part of the damex.incus collection (version 1.11.7).

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 damex.incus.

To use it in a playbook, specify: damex.incus.incus_network_zone_record.

Synopsis

  • Create, update, and delete Incus network zone records via the Incus REST API.

  • Network zone records define DNS entries within a network zone.

  • Records are identified by name within a given zone.

Parameters

Parameter

Comments

client_cert

string

Client certificate content for remote authentication.

Requires url and client_key. Mutually exclusive with token and client_cert_path.

client_cert_path

string

Client certificate path for remote authentication.

Requires url and client_key_path. Mutually exclusive with token and client_cert.

client_key

string

Client key content for remote authentication.

Requires url and client_cert. Mutually exclusive with client_key_path.

client_key_path

string

Client key path for remote authentication.

Requires url and client_cert_path. Mutually exclusive with client_key.

config

list / elements=dictionary

User-defined configuration entries.

Each entry is flattened to a user.<name> config key.

name

string / required

Configuration key name (without the user. prefix).

value

string / required

Configuration value.

description

string

Description of the network zone record.

Default: ""

entries

list / elements=dictionary

List of DNS entries for the record.

Entries are sorted by type and value for stable idempotency.

ttl

integer

Time to live in seconds.

type

string / required

DNS record type (A, AAAA, CNAME, etc.).

value

string / required

DNS record value.

name

string / required

Name of the network zone record.

project

string

Incus project to query.

Default: "default"

server_cert

string

Server certificate content for remote verification.

Requires url. Mutually exclusive with server_cert_path.

server_cert_path

string

Server certificate path for remote verification.

Requires url. Mutually exclusive with server_cert.

socket_path

string

Incus Unix socket path for local connections.

Default: "/var/lib/incus/unix.socket"

state

string

Desired state of the network zone record.

Choices:

  • "present" ← (default)

  • "absent"

token

string

Token for remote authentication.

Requires url. Mutually exclusive with client_cert.

url

string

Remote Incus server URL (e.g. https://host:8443).

If specified, connects via HTTPS instead of Unix socket.

validate_certs

boolean

Server TLS certificate validation.

Choices:

  • false

  • true ← (default)

wait

boolean

Async operation completion wait.

Set to false for fire-and-forget behaviour.

Choices:

  • false

  • true ← (default)

zone

string / required

Name of the network zone containing the record.

Examples

- name: Ensure network zone record with A entry
  damex.incus.incus_network_zone_record:
    zone: example.com
    name: web
    entries:
      - type: A
        value: 10.0.0.5

- name: Ensure network zone record with multiple entries
  damex.incus.incus_network_zone_record:
    zone: example.com
    name: mail
    description: Mail server records
    entries:
      - type: A
        value: 10.0.0.10
      - type: AAAA
        value: fd42::10
        ttl: 300

- name: Ensure network zone record is absent
  damex.incus.incus_network_zone_record:
    zone: example.com
    name: web
    state: absent

Return Values

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

Key

Description

changed

boolean

Resource state change indicator.

Returned: always

changed_keys

list / elements=string

Configuration keys that changed.

Returned: always

diff

dictionary

Before and after state for diff mode.

Returned: changed

after

dictionary

State after the change.

Returned: success

before

dictionary

State before the change.

Returned: success

Authors

  • Roman Kuzmitskii (@damex)