Part of #376. #381 closes it once the fixed image is pinned and its 26.04 smoke checks pass.
Please squash-merge. The branch history holds the diagnosis commits; the squash message should be the fix(images) commit's.
Cause. In a booted molecule-ubuntu2604 container, become from root fails:
pam_unix(sudo:account): read unix_chkpwd output error 0: Success
root : account validation failure, is your account locked?
Not sudo-rs. The image's sudo is classic sudo 1.9.17p2 (/etc/alternatives/sudo points to sudo.ws).
The image's files are fine. They pass when run under chroot. The unix_chkpwd helper that pam_unix's account check runs fails only inside the container (exit 127 when called directly, under Docker's seccomp filter).
Why the helper fails is not confirmed. Seccomp is the likely reason. This change works around it rather than fixing it.
Fix (images/molecule-ubuntu2604/Dockerfile):
/etc/pam.d/sudo gets account sufficient pam_rootok.so before @include common-account. Root's sudo, which is what Ansible's become runs as in these containers, skips the helper. A non-root caller still goes through pam_unix, as on a real 26.04 host. The build fails if the line does not apply.
gnupg is added, as in the 24.04 image: the docker and gitea scenarios need it on the target.
The contents label and docs/images/molecule-ubuntu2604.md are updated to match.
extensions/molecule/image-smoke (24.04) gets a become check. It passes on the current pin.
Sequence, following the 24.04 gnupg precedent (image first, then pin and tests):
This PR. images/* and docs/* select no Molecule scenario; the 24.04 smoke runs.
On merge, CI builds molecule-ubuntu2604:0.1.7 and Renovate opens the pin PR.
#381 moves to that pin. It adds the 26.04 smoke become and gnupg checks and runs every role on 26.04.
Layer size estimate:gnupg and its dependencies (gpg, gpg-agent, dirmngr, gpgsm, keyboxd) add about 3–5 MB compressed, for a RUN layer of about 35 MB. That is well under the 100 MB limit. The figure is an estimate, not measured.
Verified
Run 5650, with the pam_rootok line applied at runtime in the 26.04 smoke container:
before the edit, sudo -n -u root true fails with the error above;
after it, sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS' succeeds and the become check passes;
the 24.04 smoke become check passes as well.
Run 5647: uid=0, nsswitch uses files, and the root shadow entry is the same as in the image file.
Under chroot, the extracted 26.04 rootfs passes sudo -H -S -n -u root, both with full capabilities and with Docker's default set.
pre-commit run --all-files and scripts/check_image_versions.py pins pass.
Not verified
The image build itself: it runs only on main. The sed line is guarded by grep -qx, so the build fails if it does not apply.
The built 0.1.7 image: it is proven by the 26.04 smoke checks in #381 after the pin.
The root cause of the unix_chkpwd failure.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code
## What and why
Part of #376. #381 closes it once the fixed image is pinned and its 26.04 smoke checks pass.
**Please squash-merge.** The branch history holds the diagnosis commits; the squash message should be the `fix(images)` commit's.
**Cause.** In a booted `molecule-ubuntu2604` container, `become` from root fails:
```
pam_unix(sudo:account): read unix_chkpwd output error 0: Success
root : account validation failure, is your account locked?
```
- **Not sudo-rs.** The image's `sudo` is classic sudo 1.9.17p2 (`/etc/alternatives/sudo` points to `sudo.ws`).
- **The image's files are fine.** They pass when run under `chroot`. The `unix_chkpwd` helper that `pam_unix`'s account check runs fails only inside the container (exit 127 when called directly, under Docker's seccomp filter).
- **Why the helper fails is not confirmed.** Seccomp is the likely reason. This change works around it rather than fixing it.
**Fix** (`images/molecule-ubuntu2604/Dockerfile`):
- `/etc/pam.d/sudo` gets `account sufficient pam_rootok.so` before `@include common-account`. Root's sudo, which is what Ansible's `become` runs as in these containers, skips the helper. A non-root caller still goes through `pam_unix`, as on a real 26.04 host. The build fails if the line does not apply.
- `gnupg` is added, as in the 24.04 image: the docker and gitea scenarios need it on the target.
- The contents label and `docs/images/molecule-ubuntu2604.md` are updated to match.
- `extensions/molecule/image-smoke` (24.04) gets a `become` check. It passes on the current pin.
**Sequence**, following the 24.04 `gnupg` precedent (image first, then pin and tests):
1. This PR. `images/*` and `docs/*` select no Molecule scenario; the 24.04 smoke runs.
2. On merge, CI builds `molecule-ubuntu2604:0.1.7` and Renovate opens the pin PR.
3. #381 moves to that pin. It adds the 26.04 smoke `become` and `gnupg` checks and runs every role on 26.04.
**Layer size estimate:** `gnupg` and its dependencies (gpg, gpg-agent, dirmngr, gpgsm, keyboxd) add about 3–5 MB compressed, for a RUN layer of about 35 MB. That is well under the 100 MB limit. The figure is an estimate, not measured.
## Verified
- Run 5650, with the `pam_rootok` line applied at runtime in the 26.04 smoke container:
- before the edit, `sudo -n -u root true` fails with the error above;
- after it, `sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS'` succeeds and the `become` check passes;
- the 24.04 smoke `become` check passes as well.
- Run 5647: `uid=0`, `nsswitch` uses `files`, and the root shadow entry is the same as in the image file.
- Under `chroot`, the extracted 26.04 rootfs passes `sudo -H -S -n -u root`, both with full capabilities and with Docker's default set.
- `pre-commit run --all-files` and `scripts/check_image_versions.py pins` pass.
## Not verified
- **The image build itself:** it runs only on `main`. The `sed` line is guarded by `grep -qx`, so the build fails if it does not apply.
- **The built `0.1.7` image:** it is proven by the 26.04 smoke checks in #381 after the pin.
- **The root cause** of the `unix_chkpwd` failure.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none.
Assisted-by: Claude Code
Defame1297
was assigned by Claude2026-11-25 21:29:42 +00:00
Both smoke scenarios now run a become task, as every role scenario does,
so a molecule image where become fails no longer passes its own pin pull
request. The 26.04 scenario also carries temporary diagnostics for #376.
Assisted-by: Claude Code
In the booted 26.04 container, pam_unix's account check for sudo runs
the unix_chkpwd helper, which fails there, so become from root fails
with "account validation failure". /etc/pam.d/sudo now lets root
through with pam_rootok before common-account; a non-root caller still
goes through pam_unix. The build fails if the line does not apply.
gnupg joins the image, as in the 24.04 image: the docker and gitea
scenarios need it on the target. The temporary diagnostics are removed.
Closes#376
Assisted-by: Claude Code
The 26.04 smoke checks run against the pinned image, which gains the
fix only after this change is built and pinned; they follow with the
pin.
Assisted-by: Claude Code
Claude
changed title from WIP: fix(images): make become work on the 26.04 molecule image and add gnupg to fix(images): let become work on molecule-ubuntu2604 and add gnupg2026-11-25 21:48:37 +00:00
CODEOWNERS rules
requested review from Defame1297 2026-11-25 21:48:37 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Part of #376. #381 closes it once the fixed image is pinned and its 26.04 smoke checks pass.
Please squash-merge. The branch history holds the diagnosis commits; the squash message should be the
fix(images)commit's.Cause. In a booted
molecule-ubuntu2604container,becomefrom root fails:sudois classic sudo 1.9.17p2 (/etc/alternatives/sudopoints tosudo.ws).chroot. Theunix_chkpwdhelper thatpam_unix's account check runs fails only inside the container (exit 127 when called directly, under Docker's seccomp filter).Fix (
images/molecule-ubuntu2604/Dockerfile):/etc/pam.d/sudogetsaccount sufficient pam_rootok.sobefore@include common-account. Root's sudo, which is what Ansible'sbecomeruns as in these containers, skips the helper. A non-root caller still goes throughpam_unix, as on a real 26.04 host. The build fails if the line does not apply.gnupgis added, as in the 24.04 image: the docker and gitea scenarios need it on the target.docs/images/molecule-ubuntu2604.mdare updated to match.extensions/molecule/image-smoke(24.04) gets abecomecheck. It passes on the current pin.Sequence, following the 24.04
gnupgprecedent (image first, then pin and tests):images/*anddocs/*select no Molecule scenario; the 24.04 smoke runs.molecule-ubuntu2604:0.1.7and Renovate opens the pin PR.becomeandgnupgchecks and runs every role on 26.04.Layer size estimate:
gnupgand its dependencies (gpg, gpg-agent, dirmngr, gpgsm, keyboxd) add about 3–5 MB compressed, for a RUN layer of about 35 MB. That is well under the 100 MB limit. The figure is an estimate, not measured.Verified
pam_rootokline applied at runtime in the 26.04 smoke container:sudo -n -u root truefails with the error above;sudo -H -S -n -u root /bin/sh -c 'echo BECOME-SUCCESS'succeeds and thebecomecheck passes;becomecheck passes as well.uid=0,nsswitchusesfiles, and the root shadow entry is the same as in the image file.chroot, the extracted 26.04 rootfs passessudo -H -S -n -u root, both with full capabilities and with Docker's default set.pre-commit run --all-filesandscripts/check_image_versions.py pinspass.Not verified
main. Thesedline is guarded bygrep -qx, so the build fails if it does not apply.0.1.7image: it is proven by the 26.04 smoke checks in #381 after the pin.unix_chkpwdfailure.NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code
WIP: fix(images): make become work on the 26.04 molecule image and add gnupgto fix(images): let become work on molecule-ubuntu2604 and add gnupg