arillso.system.firewall role – Configure nftables firewall with intuitive YAML structure
Note
This role is part of the arillso.system collection (version 1.0.5).
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 arillso.system.
To use it in a playbook, specify: arillso.system.firewall.
Entry point main – Configure nftables firewall with intuitive YAML structure
Synopsis
Manages nftables firewall using your elegant YAML table/chain/rule structure
Supports hierarchical Global → Group → Host inheritance and merging
Direct mapping from YAML to nftables configuration
Parameters
Parameter |
Comments |
|---|---|
Main nftables configuration (defaults/main.yml) Default: |
|
nftables table configuration |
|
List of chains in this table |
|
Netfilter hook Choices:
|
|
Chain name |
|
Default chain policy Choices:
|
|
Chain priority |
|
List of rules in this chain |
|
Rule action Choices:
|
|
Rule comment/description |
|
Connection tracking direction Choices:
|
|
Connection tracking mark |
|
Connection tracking state |
|
Connection tracking status |
|
Target chain for goto action |
|
ICMP code |
|
ICMP type |
|
ICMPv6 type |
|
Input interface name |
|
IPv6 destination address/network |
|
Reference to IPv6 destination address set |
|
IPv6 next header |
|
IPv6 source address/network |
|
Reference to IPv6 source address set |
|
Destination IP address/network |
|
Reference to IPv4 destination address set |
|
IP protocol |
|
Source IP address/network |
|
Reference to IPv4 source address set (e.g., “@trusted_networks”) |
|
NFLOG group number |
|
Log level Choices:
|
|
Log prefix for logging rules |
|
Queue threshold for logging |
|
Snapshot length for logging |
|
Packet length condition (e.g., “> 1000”) |
|
Packet mark value |
|
Network protocol family Choices:
|
|
Protocol type |
|
Output interface name |
|
Queue number for userspace processing |
|
Reject with specific reason Choices:
|
|
Target chain for jump action |
|
TCP destination port(s) |
|
Reference to TCP destination port set (e.g., “@web_ports”) |
|
TCP source port(s) |
|
Reference to TCP source port set |
|
Target for DNAT action |
|
UDP destination port(s) |
|
Reference to UDP destination port set |
|
UDP source port(s) |
|
Reference to UDP source port set |
|
Chain type Choices:
|
|
Address family Choices:
|
|
Table name (filter, nat, etc.) |
|
Global nftables configuration (from group_vars/all.yml) |
|
nftables table configuration |
|
List of chains in this table |
|
Netfilter hook Choices:
|
|
Chain name |
|
Default chain policy Choices:
|
|
Chain priority |
|
List of rules in this chain |
|
Rule action Choices:
|
|
Rule comment/description |
|
Connection tracking direction Choices:
|
|
Connection tracking mark |
|
Connection tracking state |
|
Connection tracking status |
|
Target chain for goto action |
|
ICMP code |
|
ICMP type |
|
ICMPv6 type |
|
Input interface name |
|
IPv6 destination address/network |
|
Reference to IPv6 destination address set |
|
IPv6 next header |
|
IPv6 source address/network |
|
Reference to IPv6 source address set |
|
Destination IP address/network |
|
Reference to IPv4 destination address set |
|
IP protocol |
|
Source IP address/network |
|
Reference to IPv4 source address set (e.g., “@trusted_networks”) |
|
NFLOG group number |
|
Log level Choices:
|
|
Log prefix for logging rules |
|
Queue threshold for logging |
|
Snapshot length for logging |
|
Packet length condition (e.g., “> 1000”) |
|
Packet mark value |
|
Network protocol family Choices:
|
|
Protocol type |
|
Output interface name |
|
Queue number for userspace processing |
|
Reject with specific reason Choices:
|
|
Target chain for jump action |
|
TCP destination port(s) |
|
Reference to TCP destination port set (e.g., “@web_ports”) |
|
TCP source port(s) |
|
Reference to TCP source port set |
|
Target for DNAT action |
|
UDP destination port(s) |
|
Reference to UDP destination port set |
|
UDP source port(s) |
|
Reference to UDP source port set |
|
Chain type Choices:
|
|
Address family Choices:
|
|
Table name (filter, nat, etc.) |
|
Group-specific nftables configuration (from group_vars) |
|
nftables table configuration |
|
List of chains in this table |
|
Netfilter hook Choices:
|
|
Chain name |
|
Default chain policy Choices:
|
|
Chain priority |
|
List of rules in this chain |
|
Rule action Choices:
|
|
Rule comment/description |
|
Connection tracking direction Choices:
|
|
Connection tracking mark |
|
Connection tracking state |
|
Connection tracking status |
|
Target chain for goto action |
|
ICMP code |
|
ICMP type |
|
ICMPv6 type |
|
Input interface name |
|
IPv6 destination address/network |
|
Reference to IPv6 destination address set |
|
IPv6 next header |
|
IPv6 source address/network |
|
Reference to IPv6 source address set |
|
Destination IP address/network |
|
Reference to IPv4 destination address set |
|
IP protocol |
|
Source IP address/network |
|
Reference to IPv4 source address set (e.g., “@trusted_networks”) |
|
NFLOG group number |
|
Log level Choices:
|
|
Log prefix for logging rules |
|
Queue threshold for logging |
|
Snapshot length for logging |
|
Packet length condition (e.g., “> 1000”) |
|
Packet mark value |
|
Network protocol family Choices:
|
|
Protocol type |
|
Output interface name |
|
Queue number for userspace processing |
|
Reject with specific reason Choices:
|
|
Target chain for jump action |
|
TCP destination port(s) |
|
Reference to TCP destination port set (e.g., “@web_ports”) |
|
TCP source port(s) |
|
Reference to TCP source port set |
|
Target for DNAT action |
|
UDP destination port(s) |
|
Reference to UDP destination port set |
|
UDP source port(s) |
|
Reference to UDP source port set |
|
Chain type Choices:
|
|
Address family Choices:
|
|
Table name (filter, nat, etc.) |
|
Host-specific nftables configuration (from host_vars) |
|
nftables table configuration |
|
List of chains in this table |
|
Netfilter hook Choices:
|
|
Chain name |
|
Default chain policy Choices:
|
|
Chain priority |
|
List of rules in this chain |
|
Rule action Choices:
|
|
Rule comment/description |
|
Connection tracking direction Choices:
|
|
Connection tracking mark |
|
Connection tracking state |
|
Connection tracking status |
|
Target chain for goto action |
|
ICMP code |
|
ICMP type |
|
ICMPv6 type |
|
Input interface name |
|
IPv6 destination address/network |
|
Reference to IPv6 destination address set |
|
IPv6 next header |
|
IPv6 source address/network |
|
Reference to IPv6 source address set |
|
Destination IP address/network |
|
Reference to IPv4 destination address set |
|
IP protocol |
|
Source IP address/network |
|
Reference to IPv4 source address set (e.g., “@trusted_networks”) |
|
NFLOG group number |
|
Log level Choices:
|
|
Log prefix for logging rules |
|
Queue threshold for logging |
|
Snapshot length for logging |
|
Packet length condition (e.g., “> 1000”) |
|
Packet mark value |
|
Network protocol family Choices:
|
|
Protocol type |
|
Output interface name |
|
Queue number for userspace processing |
|
Reject with specific reason Choices:
|
|
Target chain for jump action |
|
TCP destination port(s) |
|
Reference to TCP destination port set (e.g., “@web_ports”) |
|
TCP source port(s) |
|
Reference to TCP source port set |
|
Target for DNAT action |
|
UDP destination port(s) |
|
Reference to UDP destination port set |
|
UDP source port(s) |
|
Reference to UDP source port set |
|
Chain type Choices:
|
|
Address family Choices:
|
|
Table name (filter, nat, etc.) |