ci(molecule): run Molecule with the toolchain baked into the ci image instead of the runner's venv #225
Notifications
Due Date
No due date set.
Blocks
Depends on
#164 docs: correct stale claims about roles, licensing, the ansible-core floor and build_ignore
Mortis/Kamino
Reference: Mortis/Kamino#225
Reference in new issue
Block a user
Spec: Supported and tested ansible-core versions, resolution comment, item 5. How the job reaches the Docker daemon is decided by Molecule and Renovate on the shared runner; follow that resolution.
What to build
moleculeand its Docker driver (molecule-plugins[docker]or whatever the scenarios use today) inrequirements-dev.txtand regenerate the lock (scripts/lock-requirements.sh)..gitea/workflows/molecule.ymlto run molecule from the pinnedciimage (image:<version>@sha256:<digest>), not fromMOLECULE_VENV=/opt/molecule-venv. Drop the "provisioned on the runner by the gitea_runner role" comment and the step that checks for that venv.requirements-dev.txtpins, so the stated floor is behaviour-tested.Not in this issue
Acceptance
molecule.ymlno longer refers to/opt/molecule-venv.Docker access decided in Molecule and Renovate on the shared runner: isolation, capacity and cost, item 2. The Molecule job stays a host-executor job on
kamino-moleculeand runsdocker runon the pinnedciimage, with/var/run/docker.sockand the checkout mounted at the same path inside as outside. Molecule in that container starts the scenario containers beside it on the runner's daemon (their/sys/fs/cgroupmounts resolve on the host). No job container (container:) gets the socket, and the runner config does not change. Keep themolecule.ymlheader true: the job is root-equivalent on the runner, as before. Pass ref and run values to the container throughenv:/-e, never by interpolating them intorun:. This issue is now unblocked; #166 waits on it.Review of the map (2026-11-17).
ciimage pinned by digest, with no install path for changed pins. So Renovate's ansible-core bump runs every scenario on the old core in its own pull request, although Supported and tested ansible-core versions says the bump "is behaviour-tested by its own PR". Whether the job installs a pull request's changed pins is open in What Molecule proves before a merge, and who acts on the nightly run.ciimage version in the same PR" no longer applies once CI assigns the version.extensions/molecule/requirements.yml(the Docker driver's collection) becomes an input of theciimage: copy it, install it into/opt/collections, add it to/opt/ci-pins.sha256, toimage.yml'spaths:and to the list of image inputs in the agent context. Reason: the bake-in rule; the image does not read that file today.ciimage stays below 100 MB.docker runcontainer needs the per-run name and label; see the cancel note on the isolation issue.Changed: this issue is now blocked by that ticket, because one of its options changes the job this issue builds. feat(images): add a Debian 13 molecule image and test the Proxmox targets on it is now blocked by this issue.
Scope change from What Molecule proves before a merge, and who acts on the nightly run (2026-11-20)
/opt/ci-pins.sha256, as Lint and Build do. When they differ, it installs the pull request's pins (requirements-dev.lockwithrequirements-dev.txt, andrequirements.yml) before any scenario runs. Without this, the pull request that raises the ansible-core floor runs every scenario on the old core and then automerges.requirements-dev.txtandrequirements-dev.lockstay on the selector's IGNORED list. A core minor bump selects every scenario through itsmeta/runtime.ymledit. Other pin bumps select none.ansible --versionin the job).Body edited on 2026-11-20 (final validation round of the map, #87 (comment)): removed the instruction to bump the
ciimage version by hand in the pin PR, because #165 blocks this issue and makes CI assign image versions.Closed by #345, with a follow-up fix in #348. Acceptance:
ci:0.2.40.ansible [core 2.22.0].molecule.ymlno longer refers to/opt/molecule-venv: done in #345.cilayer stays below 100 MB: 0.2.40 pushed. Estimated growth was +0.76 MB in/opt/venvand +0.63 MB in/opt/collections.Two fixes were found only in CI, after #345:
community.docker.dockerconnection plugin runs thedockerCLI. The host's CLI is mounted read-only into the container. Whether to bake it into the image instead is a separate issue.~<user>/.ansible/tmpdid not expand. The job now mounts a generated passwd file whose home is the job-treeHOME.In scope by the maintainer's decision:
gitea_runnerno longer installs the molecule venv and collections (breaking; changelog fragment in #345).Assisted-by: Claude Code