test(molecule): bake prepare.yml fixtures into the molecule images #170
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: Mortis/Kamino#170
Reference in new issue
Block a user
Spec: CI image pipeline: keep, simplify or replace, resolution section 2, and Molecule and Renovate on the shared runner: isolation, capacity and cost, item 4 (narrowed by the final validation round of the map, #87 (comment), decision 4). This comes after refactor(images): image docs next to the images, check_image_versions.py pins only. The rule: bake in as much as possible, except what a role installs itself.
What
prepare.ymlinstalls (for exampleroles/system_baseline/molecule/default/prepare.yml) are test fixtures. Move them into the molecule image and drop the install fromprepare.yml, or keep it as a no-op assertion. Theufwpackage is the exception: see below.ufwandfail2banfrom every molecule Dockerfile that exists when this lands (the Debian 13 one included): the ufw and fail2ban roles install them.openssh-serverandiptablesstay baked in, because no role installs them (thesshdrole only writes configuration). Keep the fixtures that no role installs.extensions/molecule/image-smoke*/verify.ymlasserts all four packages; adjust it to match (onlyopenssh-serverandiptablesremain).prepare.ymlof theufw,fail2banandtraefikscenarios (thetraefikscenario's converge runsmortis.kamino.ufwfirst), and to any other scenario that runs one of those two roles. Onlysystem_baseline'sprepare.ymlrefreshes the cache today. Theufwscenario'sprepare.ymlkeeps its "Install ufw" task, after the refresh: it must exist before the role runs, because prepare seeds rules withcommunity.general.ufw. The consequence: in theufwscenario the package is present before the role runs, so the role's own install task is exercised only where another scenario runs the role on an image without it (thetraefikscenario). Do not change the roles.contentslabel and doc to the packages that remain.Acceptance
ufwandfail2banare installed by their roles.ufwscenario, theufwpackage.Scope added by Molecule and Renovate on the shared runner: isolation, capacity and cost, item 4. The rule is: bake in as much as possible, except what a role installs itself. So in the same change, remove the packages the roles manage (
iptables,ufw,fail2ban,openssh-server) from both molecule Dockerfiles, and keep the fixtures that no role installs. Remove "a converge makes no network calls" and the list of preinstalled role packages from each image's description label and from its image doc. Bump each image version, since this is an image input. Check that every role's scenario still passes once its packages are installed by the role.Review of the map (2026-11-17).
iptables,ufw,fail2banandopenssh-server. By the rule it states (bake in everything except what a role installs itself), onlyufwandfail2bancome out: the ufw and fail2ban roles install them. No role installsopenssh-serveroriptables; thesshdrole only writes configuration. Those two stay baked.prepare.ymlrefreshes the cache. Do not change the roles. Not run; it follows from the Dockerfile and the apt module.extensions/molecule/image-smoke*/verify.yml, which assert all four packages.Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, #87 (comment)). The body is the spec; the earlier comments are history.
ufwandfail2banleave the molecule images;openssh-serverandiptablesstay,image-smoke*/verify.ymlis adjusted to match, andprepare.ymlkeeps the apt cache refresh (acceptance now "downloads no package").Final validation round, second pass (2026-11-20): body edited.
roles/ufw/molecule/default/prepare.ymlas a fixture to move into the image.prepare.ymlof theufw,fail2banandtraefikscenarios (the traefik converge runsmortis.kamino.ufw) and any other scenario that runs one of those two roles. Theufwprepare keeps "Install ufw" after the refresh, with the consequence for the role's own install task stated.ufwscenario, theufwpackage.