molecule-ubuntu2604: become fails with a sudo account validation failure #376

Open
opened 2026-11-25 19:28:48 +00:00 by Claude · 1 comment
Owner

Problem

In the molecule-ubuntu2604 image, a task with become: true fails, although molecule connects as root:

fatal: [<run>-pihole-resolute]: FAILED! => {"changed": false,
  "module_stderr": "sudo: account validation failure, is your account locked?\nsudo: a password is required\n",
  "msg": "Module result deserialization failed: No start of json char found", "rc": 1}

Seen in the pihole scenario of #372 (Actions run 5566, the first check step, task "Create system user and group"). The same task passed on the molecule-ubuntu2404 instance in the same run.

No role scenario ran on the 26.04 image before, and the image-smoke-2604 scenario checks only that the sudo package is installed, never become, so nothing caught it.

Likely cause (not verified)

The message looks like sudo-rs, which I believe recent Ubuntu releases use as the default sudo. It appears to check the PAM account even for root, and that check fails for root in this image. This is not reproduced outside CI, so the cause is a guess.

Impact

No role can declare resolute while its scenario uses become. The platform rules in roles/AGENTS.md ("declared means tested") then keep every Ubuntu role on noble. #372 dropped resolute from pihole for this reason and lists it as an untested platform.

Proposed work

  • Find the cause in the 26.04 image (the root account's shadow entry or PAM account stack, or sudo-rs versus classic sudo) and fix it in images/molecule-ubuntu2604/Dockerfile.
  • Add a become check to extensions/molecule/image-smoke-2604 (and the 24.04 smoke scenario, for parity), so a regression fails the image build.
  • Release and pin the image as usual.
  • Follow-up: add resolute back to pihole (platform, scenario and README).

Acceptance criteria

  • A become: true task succeeds on a molecule-ubuntu2604 instance, proven by the smoke scenario.
  • The pihole scenario passes on both images.

Assisted-by: Claude Code:claude-opus-5-5

## Problem In the `molecule-ubuntu2604` image, a task with `become: true` fails, although molecule connects as root: ```text fatal: [<run>-pihole-resolute]: FAILED! => {"changed": false, "module_stderr": "sudo: account validation failure, is your account locked?\nsudo: a password is required\n", "msg": "Module result deserialization failed: No start of json char found", "rc": 1} ``` Seen in the `pihole` scenario of #372 (Actions run 5566, the first `check` step, task "Create system user and group"). The same task passed on the `molecule-ubuntu2404` instance in the same run. No role scenario ran on the 26.04 image before, and the `image-smoke-2604` scenario checks only that the `sudo` package is installed, never `become`, so nothing caught it. ## Likely cause (not verified) The message looks like sudo-rs, which I believe recent Ubuntu releases use as the default `sudo`. It appears to check the PAM account even for root, and that check fails for root in this image. This is not reproduced outside CI, so the cause is a guess. ## Impact No role can declare `resolute` while its scenario uses `become`. The platform rules in `roles/AGENTS.md` ("declared means tested") then keep every Ubuntu role on `noble`. #372 dropped `resolute` from `pihole` for this reason and lists it as an untested platform. ## Proposed work - [ ] Find the cause in the 26.04 image (the root account's shadow entry or PAM account stack, or sudo-rs versus classic sudo) and fix it in `images/molecule-ubuntu2604/Dockerfile`. - [ ] Add a `become` check to `extensions/molecule/image-smoke-2604` (and the 24.04 smoke scenario, for parity), so a regression fails the image build. - [ ] Release and pin the image as usual. - [ ] Follow-up: add `resolute` back to `pihole` (platform, scenario and README). ## Acceptance criteria - A `become: true` task succeeds on a `molecule-ubuntu2604` instance, proven by the smoke scenario. - The `pihole` scenario passes on both images. Assisted-by: Claude Code:claude-opus-5-5
Author
Owner

Confirmed on every role, not only pihole: in #381 (Actions run 5611) each *-2604-instance fails on its first become task with the same sudo: account validation failure. The 24.04 instances pass.

Scope addition: images/molecule-ubuntu2604/Dockerfile also lacks gnupg, which images/molecule-ubuntu2404/Dockerfile installs. The docker scenario (signed stub apt repository, files/build-stub-repo.sh) and the gitea scenario and role (gpg --verify) need it on the target. Add it in the same image change, so one release and pin fixes both. This replaces #378.

The follow-up "add resolute back to pihole" is done in #381, together with docker and gitea, once this image is pinned.

Assisted-by: Claude Code

Confirmed on every role, not only pihole: in #381 (Actions run 5611) each `*-2604-instance` fails on its first `become` task with the same `sudo: account validation failure`. The 24.04 instances pass. Scope addition: `images/molecule-ubuntu2604/Dockerfile` also lacks `gnupg`, which `images/molecule-ubuntu2404/Dockerfile` installs. The docker scenario (signed stub apt repository, `files/build-stub-repo.sh`) and the gitea scenario and role (`gpg --verify`) need it on the target. Add it in the same image change, so one release and pin fixes both. This replaces #378. The follow-up "add `resolute` back to `pihole`" is done in #381, together with docker and gitea, once this image is pinned. Assisted-by: Claude Code
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#376