ufw
Collection: community.general
Full Name: parallax.community.general.ufw
Aliases: community.general.ufw, ufw
Synopsis
Manage ufw
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| rule | string | allow | Firewall rule action (allow, deny, reject, limit) | |
| port | string | Port number or range to apply rule to | ||
| proto | string | any | Protocol for the rule (tcp, udp, any) | |
| state | string | State of UFW (enabled, disabled, reloaded, reset) | ||
| direction | string | Direction of traffic (in, out, incoming, outgoing, routed) | ||
| from_ip | string | any | Source IP address | |
| to_ip | string | any | Destination IP address | |
| delete | bool | false | Delete the rule instead of adding it | |
| route | bool | false | Apply rule to routed/forwarded packets | |
| log | bool | false | Log packets matching the rule | |
| comment | string | Comment for the rule | ||
| interface_name | string | Network interface name for the rule |
Example
- name: Example ufw task
ufw:
rule: allow
port: <your_port>