damex.incus.incus_network_address_set module – Ensure Incus network address set

Note

This module is part of the damex.incus collection (version 1.9.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 damex.incus.

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

Synopsis

  • Create, update, and delete Incus network address sets via the Incus REST API.

  • Network address sets define reusable groups of IPv4 and IPv6 addresses that can be referenced in network ACL rules.

  • Address sets are referenced in ACL source and destination fields using a dollar sign prefix (e.g. $set_name).

Parameters

Parameter

Comments

addresses

list / elements=string

List of IPv4 or IPv6 addresses, with or without CIDR suffix.

A mix of IPv4, IPv6, and CIDR notation is supported.

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

Path to the client certificate 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

Path to the client key for remote authentication.

Requires url and client_cert_path. Mutually exclusive with client_key.

config

dictionary

Network address set configuration key-value pairs.

Only user-defined keys (user.*) are supported.

Default: {}

description

string

Description of the network address set.

Default: ""

name

string / required

Name of the network address set.

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

Path to the server certificate for remote verification.

Requires url. Mutually exclusive with server_cert.

socket_path

string

Path to the Incus Unix socket for local connections.

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

state

string

Desired state of the network address set.

Choices:

  • "present" ← (default)

  • "absent"

token

string

Token for remote authentication.

Requires url. Mutually exclusive with client_cert.

url

string

URL of the remote Incus server (e.g. https://host:8443).

If specified, connects via HTTPS instead of Unix socket.

validate_certs

boolean

Whether to validate the server TLS certificate.

Choices:

  • false

  • true ← (default)

wait

boolean

Whether to wait for async operations to complete before returning.

Set to false for fire-and-forget behaviour.

Choices:

  • false

  • true ← (default)

Examples

- name: Ensure network address set with IPv4 addresses
  damex.incus.incus_network_address_set:
    name: web_servers
    description: Web server addresses
    addresses:
      - 10.0.0.5
      - 10.0.0.6

- name: Ensure network address set with mixed addresses
  damex.incus.incus_network_address_set:
    name: dns_servers
    addresses:
      - 10.0.0.10
      - 2001:db8::1
      - 192.168.1.0/24

- name: Ensure network address set is absent
  damex.incus.incus_network_address_set:
    name: web_servers
    state: absent

Authors

  • Roman Kuzmitskii (@damex)