fix(molecule): give the runner user a passwd entry in the ci container #348

Merged
Defame1297 merged 1 commits from fix/molecule-passwd-entry into main 2026-11-24 09:05:14 +00:00
Owner

What and why

Follow-up to #345 (#225). Molecule on the ci pin pull request #346 failed in every scenario at create. The error was "Failed to create temporary directory", from mkdir -p "$(echo ~gitea-runner/.ansible/tmp)" on localhost.

  • Cause: the runner's uid has no passwd entry in the ci image, so ~gitea-runner does not expand and mkdir runs relative to the playbook directory.
    • In #345's run, molecule came from the PR's pins in a venv in the job tree, so that directory was writable.
    • On #346 it came from the image's /opt/venv, which is read-only for the runner user.
  • Fix: the job writes a two-line passwd file, root plus the runner user with its home set to the job-tree HOME. It mounts the file read-only over /etc/passwd, so ~<user> resolves to a writable directory.
  • Pin: CI_IMAGE in molecule.yml moves to ci:0.2.40, the digest #346 proposes. With the new pin, this pull request runs the image's own toolchain, which is the path that failed. Without it, this run would install its own pins first and miss the bug. Renovate then rebases #346 down to the lint.yml and build.yml pins.

No changelog fragment: CI only.

Verified

  • Commit hooks (yamllint, actionlint, zizmor) and pre-push ansible-test sanity pass.
  • The passwd lines the job writes have the right format (checked locally).
  • Cause: compared the logs of run 5302 (#345, passed, slow path) and run 5321 (#346, failed, baked path). ansible-core 2.22.0 and molecule 26.11.0 were the same in both; the only difference was where the driver's playbooks live.

Not verified

  • Molecule on this head: this pull request's run is the test.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Follow-up to #345 (#225). Molecule on the ci pin pull request #346 failed in every scenario at `create`. The error was "Failed to create temporary directory", from `mkdir -p "$(echo ~gitea-runner/.ansible/tmp)"` on localhost. - **Cause:** the runner's uid has no passwd entry in the `ci` image, so `~gitea-runner` does not expand and `mkdir` runs relative to the playbook directory. - In #345's run, molecule came from the PR's pins in a venv in the job tree, so that directory was writable. - On #346 it came from the image's `/opt/venv`, which is read-only for the runner user. - **Fix:** the job writes a two-line passwd file, `root` plus the runner user with its home set to the job-tree `HOME`. It mounts the file read-only over `/etc/passwd`, so `~<user>` resolves to a writable directory. - **Pin:** `CI_IMAGE` in `molecule.yml` moves to `ci:0.2.40`, the digest #346 proposes. With the new pin, this pull request runs the image's own toolchain, which is the path that failed. Without it, this run would install its own pins first and miss the bug. Renovate then rebases #346 down to the `lint.yml` and `build.yml` pins. No changelog fragment: CI only. ## Verified - Commit hooks (yamllint, actionlint, zizmor) and pre-push `ansible-test sanity` pass. - The passwd lines the job writes have the right format (checked locally). - Cause: compared the logs of run 5302 (#345, passed, slow path) and run 5321 (#346, failed, baked path). ansible-core 2.22.0 and molecule 26.11.0 were the same in both; the only difference was where the driver's playbooks live. ## Not verified - Molecule on this head: this pull request's run is the test. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-11-24 08:48:45 +00:00
Defame1297 was assigned by Claude 2026-11-24 08:48:45 +00:00
Claude added 1 commit 2026-11-24 08:48:45 +00:00
fix(molecule): give the runner user a passwd entry in the ci container
Build / build (pull_request) Successful in 17s
Lint / lint (pull_request) Successful in 1m10s
Molecule / molecule (pull_request) Successful in 14m58s
250b04eef3
ansible makes its temp dir under ~<user>/.ansible/tmp. Without a passwd
entry the tilde does not expand and mkdir runs relative to the playbook's
directory, which is read-only under /opt/venv once the image's own
molecule is used. Move molecule.yml to ci 0.2.40 so this pull request
runs the baked toolchain that failed on the pin pull request.

Assisted-by: Claude Code
CODEOWNERS rules requested review from Defame1297 2026-11-24 08:48:45 +00:00
Defame1297 approved these changes 2026-11-24 08:49:23 +00:00
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-24 08:49:25 +00:00
Defame1297 merged commit 9e88c30dc6 into main 2026-11-24 09:05:14 +00:00
Defame1297 deleted branch fix/molecule-passwd-entry 2026-11-24 09:05:14 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#348