test(molecule): refresh the APT cache where a scenario installs ufw or fail2ban

The molecule images keep no APT lists, and the ufw and fail2ban scenarios, and the gitea
scenario's remove path, relied on those packages being baked in. Their prepare now refreshes the
cache, so they keep working once the images stop shipping the packages.

Refs: #435
Assisted-by: Claude Code
This commit is contained in:
Defame1297 committed 2026-11-29 18:53:24 +00:00
1 parent ac9a11413d
commit 6e9709f0da
4 files changed
+23 -3

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
# the service starts) is not covered. The mint tasks only assert, but the remove-path play at the
# end of verify.yml needs systemd (it stops and disables a stub unit) and ufw (it deletes the Gitea
# rules), so the container runs systemd as PID 1 with a writable cgroup and NET_ADMIN. No
# privileged mode. Both images have ufw and gnupg preinstalled, so the scenario downloads nothing.
# privileged mode. Both images have gnupg preinstalled; prepare.yml installs ufw from the archive.
driver:
name: docker
platforms:
+12
View File
@@ -0,0 +1,12 @@
---
# The remove-path play in verify.yml needs ufw, which the image does not ship. It keeps no APT
# lists, so the install refreshes them.
- name: Prepare
hosts: all
gather_facts: false
tasks:
- name: Install ufw
ansible.builtin.apt:
name: ufw
state: present
update_cache: true