--- ufw_enabled: true ufw_manage_rules: true ufw_defaults: incoming: deny outgoing: allow routed: deny ufw_logging: "on" # Lock-out guard: with a deny/reject incoming default the play refuses to run # unless an allow/limit rule for this TCP port is in the rule list, since the # default is applied before the rules and a missing rule cuts the SSH session. ufw_require_ssh_allow: true ufw_ssh_port: "{{ ansible_port | default(22, true) }}" ufw_rules: [] ufw_before_rules: [] # Keys/values written into /etc/ufw/sysctl.conf so ufw's stock file does not # reset values set by the system_baseline role of this Collection. Set per group of hosts. ufw_sysctl_overrides: [] # service_rules entry point. The owner tag is written into each rule's # comment as `[:]: `; stale detection reads it back # from `ufw show added`. The regex captures (owner, key) and must match the tag # built from the prefix: change both together, and note that changing either # orphans every rule already tagged. ufw_tag_prefix: ansible-ufw ufw_tag_regex: "comment 'ansible-ufw\\[([a-z0-9_]+):([0-9a-f]{10})\\]:" # Characters allowed in a tagged comment: printable ASCII without the single # quote (it breaks the ufw module) and the backslash. ufw_tag_comment_regex: '^[] -&(-[^-~]*\Z' # Finds the port tokens of a rule line (comment removed): a number or a range or list such as # 20:30 or 22,80, followed by /tcp, /udp, a space or the end, and not part of an address, # interface name or CIDR. A line is deleted as stale or orphaned only with exactly one plain # numeric token that is not ufw_ssh_port; every other line may carry SSH and is kept. ufw_port_token_regex: '(?