fix(ufw, fail2ban): keep the check-mode guard out of vars and test service_rules
Build / build (pull_request) Successful in 38s
Lint / lint (pull_request) Successful in 4m29s
Molecule / molecule (pull_request) Canceled after 1m14s

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
This commit is contained in:
Defame1297 committed 2026-11-29 17:10:25 +00:00
1 parent 924a0ea7a7
commit a9a973a523
9 files changed
+29 -13

No files matched your search

+2 -2
View File
@@ -13,7 +13,7 @@
LANGUAGE: C
when:
- ufw_enabled
- __ufw_can_configure
- __ufw_can_configure | default(true)
- name: Enable UFW
become: true
@@ -28,7 +28,7 @@
else 'Logging: on (' ~ ufw_logging ~ ')' }}
when:
- ufw_enabled
- __ufw_can_configure
- __ufw_can_configure | default(true)
- >-
'Status: active' not in ufw_status_verbose.stdout
or ufw_logging_expected not in ufw_status_verbose.stdout