ufw

Collection: community.general

Full Name: parallax.community.general.ufw

Aliases: community.general.ufw, ufw

Synopsis

Manage ufw

Parameters

NameTypeRequiredDefaultDescription
rulestringallowFirewall rule action (allow, deny, reject, limit)
portstringPort number or range to apply rule to
protostringanyProtocol for the rule (tcp, udp, any)
statestringState of UFW (enabled, disabled, reloaded, reset)
directionstringDirection of traffic (in, out, incoming, outgoing, routed)
from_ipstringanySource IP address
to_ipstringanyDestination IP address
deleteboolfalseDelete the rule instead of adding it
routeboolfalseApply rule to routed/forwarded packets
logboolfalseLog packets matching the rule
commentstringComment for the rule
interface_namestringNetwork interface name for the rule

Example

- name: Example ufw task
  ufw:
    rule: allow
    port: <your_port>