images: molecule images bake packages the roles install, contrary to ADR 0002 #435

Open
opened 2026-11-27 13:35:49 +00:00 by Claude · 0 comments
Owner

Part of #419

Problem

ADR 0002, docs/adr/0002-self-built-ci-and-molecule-images.md lines 15–18:

The molecule images bake in everything except what a role installs itself. The test fixtures a scenario's prepare.yml needs are baked in. Packages a role installs are still downloaded, because that install path is what the test exercises. A converge is not kept off the network.

The molecule images do the opposite. images/molecule-ubuntu2404/Dockerfile line 54 (and images/molecule-ubuntu2604/Dockerfile line 56) installs iptables ufw fail2ban, plus openssh-server, and both the header comment (line 2) and the org.opencontainers.image.description label (line 31) say:

the packages the roles manage (iptables, ufw, fail2ban, openssh-server) preinstalled, so a converge makes no network calls.

The ufw and fail2ban roles install those packages themselves (roles/ufw/vars/main.yml: ufw_package_name: ufw; roles/fail2ban/defaults/main.yml: fail2ban_package_name: fail2ban), so with the package baked in their install path is never exercised. No role was found that installs iptables or openssh-server; those may be legitimate fixtures, which the fix should decide per package.

Related: #170 (bake prepare.yml fixtures into the images).

Proposal

Bring images and ADR into line. Either remove from both Dockerfiles the packages a role installs (keeping fixtures), and fix the header comment and label; or, if baking them is wanted, supersede that ADR 0002 point with a new ADR. The issue does not choose.

Acceptance criteria

  • The Dockerfiles, their labels and comments, docs/images/ and ADR 0002 (or its successor) say the same thing (review).
  • If packages are removed: the image-smoke scenarios pass and the ufw and fail2ban scenarios pass with the role installing the package (Molecule check, log shows the install as changed on first converge).
  • pre-commit run --all-files passes.

Assisted-by: Claude Code

Part of #419 ### Problem ADR 0002, `docs/adr/0002-self-built-ci-and-molecule-images.md` lines 15–18: > **The molecule images bake in everything except what a role installs itself.** The test fixtures a scenario's `prepare.yml` needs are baked in. Packages a role installs are still downloaded, because that install path is what the test exercises. A converge is not kept off the network. The molecule images do the opposite. `images/molecule-ubuntu2404/Dockerfile` line 54 (and `images/molecule-ubuntu2604/Dockerfile` line 56) installs `iptables ufw fail2ban`, plus `openssh-server`, and both the header comment (line 2) and the `org.opencontainers.image.description` label (line 31) say: > the packages the roles manage (iptables, ufw, fail2ban, openssh-server) preinstalled, so a converge makes no network calls. The `ufw` and `fail2ban` roles install those packages themselves (`roles/ufw/vars/main.yml`: `ufw_package_name: ufw`; `roles/fail2ban/defaults/main.yml`: `fail2ban_package_name: fail2ban`), so with the package baked in their install path is never exercised. No role was found that installs `iptables` or `openssh-server`; those may be legitimate fixtures, which the fix should decide per package. Related: #170 (bake prepare.yml fixtures into the images). ### Proposal Bring images and ADR into line. Either remove from both Dockerfiles the packages a role installs (keeping fixtures), and fix the header comment and label; or, if baking them is wanted, supersede that ADR 0002 point with a new ADR. The issue does not choose. ### Acceptance criteria - [ ] The Dockerfiles, their labels and comments, `docs/images/` and ADR 0002 (or its successor) say the same thing (review). - [ ] If packages are removed: the image-smoke scenarios pass and the `ufw` and `fail2ban` scenarios pass with the role installing the package (Molecule check, log shows the install as changed on first converge). - [ ] `pre-commit run --all-files` passes. Assisted-by: Claude Code
Claude added the Kind/Bug
Status
Needs Triage
labels 2026-11-27 13:35:49 +00:00
Defame1297 added this to the CI velocity (emergency) milestone 2026-11-27 14:16:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#435