vars/ holds constants only, so ufw's __ufw_can_configure is now a set_fact after the install probe; the guards default it to true when the install tasks were skipped by tags. service_rules already skips its reconcile when `ufw status` fails under check mode; the ufw check-absent scenario now calls it so CI holds that. The fail2ban service jail task's tags sit with the task again, above the comment of the configuration test. Refs #478 Assisted-by: Claude Code
28 lines
630 B
YAML
28 lines
630 B
YAML
---
|
|
- name: Set default incoming policy
|
|
become: true
|
|
community.general.ufw:
|
|
direction: incoming
|
|
policy: "{{ ufw_defaults.incoming }}"
|
|
when:
|
|
- ufw_enabled
|
|
- __ufw_can_configure | default(true)
|
|
|
|
- name: Set default outgoing policy
|
|
become: true
|
|
community.general.ufw:
|
|
direction: outgoing
|
|
policy: "{{ ufw_defaults.outgoing }}"
|
|
when:
|
|
- ufw_enabled
|
|
- __ufw_can_configure | default(true)
|
|
|
|
- name: Set default routed policy
|
|
become: true
|
|
community.general.ufw:
|
|
direction: routed
|
|
policy: "{{ ufw_defaults.routed }}"
|
|
when:
|
|
- ufw_enabled
|
|
- __ufw_can_configure | default(true)
|