Skip to content

Fix molecule CI and make linting pass on a current toolchain - #17

Open
dgoodellrhy wants to merge 2 commits into
masterfrom
ci-fix-molecule-workflow
Open

Fix molecule CI and make linting pass on a current toolchain#17
dgoodellrhy wants to merge 2 commits into
masterfrom
ci-fix-molecule-workflow

Conversation

@dgoodellrhy

Copy link
Copy Markdown
Contributor

contains a ton of claude fixes for molecule that i uh, hope work but we're gonna find out

The molecule matrix failed on every leg with "container is not running".
Root cause: molecule.yml sets cgroupns_mode: host, but the pinned
robertdebock/molecule-action@2.0.0 image ships molecule 3.0.2, whose docker
driver passes only a fixed allowlist of docker_container parameters and
silently drops cgroupns_mode. On a cgroup v2 runner the AL2023 systemd
container then exits immediately, so prepare could not reach it.

Replace the container action with a plain toolchain install so CI runs the
same molecule the role is developed against, driven by requirements.txt.

Also drop the platform matrix. It never worked: the action only exports its
image/tag inputs as environment variables, and molecule.yml hardcodes
geerlingguy/docker-amazonlinux2023-ansible, so all four legs -- including
"centos, 8" -- were testing AL2023. Collapsing to one job removes no real
coverage. Genuine multi-distro coverage is a follow-up; CentOS 6/7/8 are EOL
with dead mirrorlists and CentOS 6 has no systemd.

Lint changes, so the modernized lint job passes:

- Fix all yamllint errors: trailing whitespace, missing EOF newlines,
  indentation, comment and comma spacing.
- Quote three implicit-octal file modes and enable yamllint's octal-values
  rule. Unquoted `mode: 0600` happens to work but is the classic footgun.
- meta/main.yml: quote min_ansible_version, and replace the CentOS platform
  with EL, which is the identifier galaxy actually defines. Declare Amazon,
  which the role supports and molecule tests.
- Replace five `== false` comparisons with `not`, name three unnamed tasks,
  set a mode on the tarball download, and make two guarded command/shell
  tasks explicit about changing state.
- Add .ansible-lint carrying a documented burn-down skip_list for the rules
  that fail broadly today (fqcn, name casing, free-form, no-handler) so the
  job enforces everything else rather than being switched off.

Verified locally: yamllint and ansible-lint both clean, and molecule test
passes converge, idempotence and verify with the role resolved the way CI
resolves it, without a global roles symlink.
The previous pins (checkout v4.3.1, setup-python v5.6.0) are Node 20 actions.
The runner currently forces them onto Node 24 and warns about it, which is the
same deprecation path that made checkout@v2 unusable. Both are now pinned to
releases that declare `using: node24` natively, so the warning goes away and
the workflow is not relying on the forcing period.
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