damex.incus.incus_network_forward module – Ensure Incus network forward
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_forward.
Synopsis
Create, update, and delete Incus network forwards via the Incus REST API.
Network forwards allow external IP addresses to be forwarded to internal addresses inside bridge and OVN networks.
Forwards are identified by their listen address within a given network.
Parameters
Parameter |
Comments |
|---|---|
Client certificate content for remote authentication. Requires |
|
Path to the client certificate for remote authentication. Requires |
|
Client key content for remote authentication. Requires |
|
Path to the client key for remote authentication. Requires |
|
Network forward configuration key-value pairs. Boolean values are converted to lowercase strings. Default: |
|
Default target address for traffic not matching any port rule. |
|
Description of the network forward. Default: |
|
Listen address of the network forward. |
|
Name of the network containing the forward. |
|
List of port forwarding rules. |
|
Description of the port rule. |
|
Port or port range to listen on. |
|
Network protocol to forward. Choices:
|
|
Whether to rewrite traffic source address. Only supported on bridge networks with nftables. Choices:
|
|
Target address to forward traffic to. |
|
Target port or port range. Defaults to listen port if not specified. |
|
Incus project to query. Default: |
|
Server certificate content for remote verification. Requires |
|
Path to the server certificate for remote verification. Requires |
|
Path to the Incus Unix socket for local connections. Default: |
|
Desired state of the network forward. Choices:
|
|
Token for remote authentication. Requires |
|
URL of the remote Incus server (e.g. https://host:8443). If specified, connects via HTTPS instead of Unix socket. |
|
Whether to validate the server TLS certificate. Choices:
|
|
Whether to wait for async operations to complete before returning. Set to Choices:
|
Examples
- name: Ensure network forward with default target
damex.incus.incus_network_forward:
network: incusbr0
name: 192.168.1.100
config:
target_address: 10.0.0.5
- name: Ensure network forward with port rules
damex.incus.incus_network_forward:
network: incusbr0
name: 192.168.1.100
description: Web server forward
ports:
- protocol: tcp
listen_port: 80,443
target_address: 10.0.0.5
- protocol: udp
listen_port: "53"
target_address: 10.0.0.10
description: DNS forward
- name: Ensure network forward is absent
damex.incus.incus_network_forward:
network: incusbr0
name: 192.168.1.100
state: absent