Skip to content

Fix docker molecule-config schema validation failure - #44

Merged
0x46616c6b merged 1 commit into
mainfrom
fix-docker-command-schema-validation
Jul 25, 2026
Merged

0x46616c6b merged 1 commit into
mainfrom
fix-docker-command-schema-validation

Conversation

@0x46616c6b

Copy link
Copy Markdown
Member

Summary

  • molecule-plugins 26.7.15 added a JSON schema for the docker driver (ansible-community/molecule-plugins#340), which requires platforms[].command to be a string.
  • The default molecule-config here sets command: "", but the yq e --inplace step that injects the prepare playbook always serializes this as YAML null regardless of the original quoting, so it never actually applied as an empty string in the generated molecule.yml.
  • With the new schema in place, that null now fails validation (ERROR Failed to validate .../molecule/github/molecule.yml), breaking Molecule integration jobs in consuming repos (e.g. Bump Userli to 6.10.2 ansible-role-userli#136) even though the role change itself is unrelated.
  • Removing the dead command: "" line keeps the same effective behavior (no command override, same as the null it always produced) while passing schema validation.

Test plan

  • Confirm a consuming repo's Molecule job (e.g. ansible-role-userli) passes with this workflow change

molecule-plugins 26.7.15 added a JSON schema for the docker driver
(ansible-community/molecule-plugins#340) requiring platforms.command
to be a string. The command: "" line here was already turned into a
YAML null by the yq e --inplace prepare-playbook step regardless of
the quoting, so it never actually applied as an empty string - only
the new schema check started rejecting the resulting null. Removing
the line keeps the same effective behavior (no command override)
while passing validation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@0x46616c6b
0x46616c6b marked this pull request as ready for review July 25, 2026 20:25
@0x46616c6b
0x46616c6b merged commit 42fe041 into main Jul 25, 2026
6 checks passed
@0x46616c6b
0x46616c6b deleted the fix-docker-command-schema-validation branch July 25, 2026 20:25
0x46616c6b added a commit to systemli/ansible-role-userli that referenced this pull request Jul 29, 2026
The debian13 integration job failed because systemd never booted as
PID 1 in the molecule-created container (systemctl is-system-running
reported "offline", PID 1 was a bare sleep loop). Root cause:
molecule-plugins 26.7.15 added schema validation for the docker
driver requiring platforms[].command to be a string, and the reusable
workflow's yq-based config injection always turned its dead
`command: ""` line into YAML null, which now fails validation
(systemli/github-ansible-workflow#44). That validation failure left
the container without a real init process.

The fix landed on main of systemli/github-ansible-workflow but hasn't
been tagged yet, so pin to that commit SHA instead of v1.6.1. Also
drop the temporary debug task and revert the MariaDB task back to
ansible.builtin.systemd now that the actual cause is fixed upstream.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0x46616c6b added a commit to systemli/ansible-role-userli that referenced this pull request Jul 29, 2026
v1.6.1 already includes the docker molecule-config schema fix
(systemli/github-ansible-workflow#44 was merged before the tag was
cut), so pinning to the commit SHA directly was unnecessary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0x46616c6b added a commit to systemli/ansible-role-userli that referenced this pull request Jul 29, 2026
Every prepare-stage failure so far (empty systemctl status, "Service
is in unknown state", "--now cannot be used when systemd is not
running") traced back to the same root cause: PID 1 inside the
molecule-created debian13 container was a bare keep-alive
`bash -c "while true; do sleep 10000; done"`, not systemd. Debug
output confirmed it: /run/systemd/system missing, systemctl
is-system-running reports "offline".

The geerlingguy/docker-debian13-ansible image's own CMD is
["/lib/systemd/systemd"], but the reusable workflow's generated
molecule/github/molecule.yml never sets an explicit `command`, so the
docker driver falls back to its own keep-alive default instead of the
image's CMD. Pinning to v1.6.1 (systemli/github-ansible-workflow#44)
fixed an unrelated schema-validation error but not this - the same
"Service is in unknown state" failure reproduced afterwards.

Override molecule-config to set `command: "/lib/systemd/systemd"`
explicitly so the image boots real systemd regardless of driver
defaults.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant