damex.incus.incus_network module – Ensure Incus network
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.
Synopsis
Create, update, and delete Incus networks via the Incus REST API.
Networks are project-scoped resources.
The network type is set on creation and cannot be changed afterwards.
Parameters
Parameter |
Comments |
|---|---|
Client certificate content for remote authentication. Requires |
|
Client certificate path for remote authentication. Requires |
|
Client key content for remote authentication. Requires |
|
Client key path for remote authentication. Requires |
|
Network configuration key-value pairs. Boolean values are converted to lowercase strings. Default: |
|
Override the next-hop for advertised IPv4 prefixes. |
|
Override the next-hop for advertised IPv6 prefixes. |
|
List of BGP peers for OVN downstream networks. Each peer is converted to Supported on bridge and physical network types used as OVN uplinks. |
|
Peer address (IPv4 or IPv6). |
|
Peer AS number. |
|
Hold time in seconds for the BGP session. |
|
Name identifier for the BGP peer. |
|
Password for the BGP session. |
|
Bridge driver to use. Choices:
|
|
Comma-separated list of unconfigured NICs to bridge. |
|
MAC address for the bridge. |
|
Bridge MTU. |
|
Domain to advertise to DHCP clients and use for DNS resolution. |
|
DNS registration mode. Choices:
|
|
Comma-separated list of DNS nameservers. |
|
Comma-separated list of DNS search domains. |
|
Comma-separated list of DNS zone names for forward DNS records. |
|
DNS zone name for IPv4 reverse DNS records. |
|
DNS zone name for IPv6 reverse DNS records. |
|
Whether to register VLAN via GARP VLAN Registration Protocol. Choices:
|
|
IPv4 address for the bridge (use none or auto). |
|
Whether to allocate addresses via DHCP. Choices:
|
|
DHCP lease expiry time. |
|
Address of the gateway for the subnet. |
|
Comma-separated list of IPv4 DHCP ranges. |
|
Additional IPv4 routes to advertise via DHCP. |
|
Whether to generate filtering firewall rules. Choices:
|
|
Override gateway for the subnet. |
|
MAC address of the gateway. |
|
Whether to NAT IPv4 traffic. Choices:
|
|
Source address for outbound IPv4 NAT. |
|
Whether to add NAT rules before or after pre-existing rules. Choices:
|
|
Comma-separated list of additional IPv4 CIDR subnets to route to the bridge. |
|
Whether to allow overlapping routes on multiple networks. Choices:
|
|
Whether to route IPv4 traffic in and out of the bridge. Choices:
|
|
IPv6 address for the bridge (use none or auto). |
|
Whether to provide additional network configuration via DHCPv6. Choices:
|
|
DHCPv6 lease expiry time. |
|
Comma-separated list of IPv6 DHCP ranges. |
|
Whether to enable stateful DHCPv6 address allocation. Choices:
|
|
Whether to generate filtering firewall rules. Choices:
|
|
Override gateway for the subnet. |
|
MAC address of the gateway. |
|
Whether to NAT IPv6 traffic. Choices:
|
|
Source address for outbound IPv6 NAT. |
|
Whether to add NAT rules before or after pre-existing rules. Choices:
|
|
Comma-separated list of additional IPv6 CIDR subnets to route to the bridge. |
|
Whether to allow overlapping routes on multiple networks. Choices:
|
|
Whether to route IPv6 traffic in and out of the bridge. Choices:
|
|
MTU of the network interface. |
|
Parent interface to use for the network. |
|
Additional dnsmasq configuration to append. |
|
Comma-separated list of network ACLs to apply. |
|
Default action for egress traffic not matching any ACL rule. Choices:
|
|
Whether to log default egress actions. Choices:
|
|
Default action for ingress traffic not matching any ACL rule. Choices:
|
|
Whether to log default ingress actions. Choices:
|
|
List of tunnels for bridge networks. Each tunnel is converted to |
|
Multicast address for VXLAN tunnels. |
|
Tunnel ID for VXLAN tunnels. |
|
Host interface to use for the tunnel. |
|
Local address for the tunnel. |
|
Name identifier for the tunnel. |
|
Destination UDP port for VXLAN tunnels. |
|
Tunneling protocol. Choices:
|
|
Remote address for the tunnel. |
|
TTL for multicast routing topologies. |
|
VLAN ID to attach to. |
|
Comma-separated list of VLAN IDs to join for tagged traffic. |
|
Network description. Default: |
|
Name of the network. |
|
Incus project to query. Default: |
|
Server certificate content for remote verification. Requires |
|
Server certificate path for remote verification. Requires |
|
Incus Unix socket path for local connections. Default: |
|
Desired state of the network. Choices:
|
|
Cluster member to target for pending network creation. |
|
Token for remote authentication. Requires |
|
Network type. Required when creating a new network. Ignored on update — type cannot be changed after creation. Choices:
|
|
Remote Incus server URL (e.g. https://host:8443). If specified, connects via HTTPS instead of Unix socket. |
|
Server TLS certificate validation. Choices:
|
|
Async operation completion wait. Set to Choices:
|
Examples
- name: Ensure bridge network
damex.incus.incus_network:
name: incusbr0
type: bridge
config:
ipv4.address: 10.0.0.1/24
ipv4.nat: true
- name: Ensure network on cluster member
damex.incus.incus_network:
name: incusbr0
type: bridge
target: node1
- name: Ensure network is finalized
damex.incus.incus_network:
name: incusbr0
type: bridge
config:
ipv4.address: 10.0.0.1/24
ipv4.nat: true
- name: Ensure bridge network with BGP peers
damex.incus.incus_network:
name: bgpbr0
type: bridge
config:
ipv4.address: 10.12.102.1/24
ipv4.nat: false
bgp_peers:
- name: router
address: 10.12.101.1
asn: 64601
- name: backup
address: 10.12.101.2
asn: 64602
holdtime: 300
- name: Ensure bridge network with VXLAN tunnel
damex.incus.incus_network:
name: multibr0
type: bridge
config:
ipv4.address: 10.0.0.1/24
tunnels:
- name: site2
protocol: vxlan
local: 192.168.1.1
remote: 192.168.1.2
id: 100
- name: Ensure network is absent
damex.incus.incus_network:
name: incusbr0
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Resource state change indicator. Returned: always |
|
Configuration keys that changed. Returned: always |
|
Before and after state for diff mode. Returned: changed |
|
State after the change. Returned: success |
|
State before the change. Returned: success |