Commit Graph
3 Commits
Author SHA1 Message Date
Defame1297 f1598486f0 test(molecule): stop saying the image ships ufw and fail2ban
Build / build (pull_request) Successful in 34s
Lint / lint (pull_request) Successful in 3m38s
Molecule / molecule (pull_request) Successful in 14m55s
Assisted-by: Claude Code
2026-11-29 18:53:24 +00:00
Defame1297 c64b4b932b ci(images): stop baking ufw and fail2ban into the molecule images
ADR 0002 keeps a package a role installs out of the molecule images, so its scenario exercises
the install. The ufw and fail2ban roles install their packages, so both images drop them; iptables,
openssh-server, python3-systemd and gnupg stay as fixtures. The labels, header comments, image
docs and image-smoke package lists no longer claim the packages are baked or that a converge
makes no network calls.

Refs: #435
Assisted-by: Claude Code
2026-11-29 18:53:24 +00:00
Defame1297 924a0ea7a7 fix(ufw, fail2ban): pass --check on a host without the package
Under --check the package task only reports a change, so on a fresh host
the tasks after it ran against a missing binary, /etc directory or unit
and failed. They now skip when the install would change in check mode.

fail2ban registers __fail2ban_install and guards its template, service,
config test, jail tasks and handler with the standard
`not ansible_check_mode or ... is not changed` guard. ufw registers
__ufw_install plus a command probe (ansible_check_mode is not set for a
play-level check_mode inside include_role), combined once in vars/main.yml
as __ufw_can_configure. flush_handlers is left unguarded: the handler it
runs is guarded itself.

A check-absent scenario per role purges the package, refreshes the APT
cache and runs only `check`, so each fix is tested; one scenario covering
both would make the ufw role a user of fail2ban and select the ufw and
traefik scenarios on every fail2ban change.

Fixes #478

Assisted-by: Claude Code
2026-11-29 16:39:45 +00:00