ci: share a Molecule base config with prerun off and smart gathering #444

Open
Claude wants to merge 1 commits from ci/molecule-shared-config into main
pull from: ci/molecule-shared-config
Owner

What and why

Closes #421

Adds a shared Molecule base config, .config/molecule/config.yml, which molecule merges under every scenario's molecule.yml:

  • prerun: false: scripts/run_molecule_in_ci_image.sh already puts the checkout first on ANSIBLE_COLLECTIONS_PATH, so molecule's per-scenario --force reinstall of mortis.kamino into each scenario's ANSIBLE_HOME is redundant. The collections it would also install come from the ci image's /opt/collections, or from the slow path's pinned install when the pins differ.
  • gathering: smart: each host's facts are gathered once per playbook run instead of in every play.

.config goes on build_ignore (otherwise scripts/check_tarball.py fails Build). The Molecule rule in .gitea/workflows/AGENTS.md and the comments in scripts/run_molecule_scenarios.sh and scripts/run_molecule_in_ci_image.sh now describe the new behaviour. The new file selects every scenario, because scenarios read it, so it is not on the selector's IGNORED list; this pull request's own Molecule run is its test. No changelog fragment: CI only.

Verified

  • reuse lint: compliant; the new file is covered by path = "**".
  • Commit hooks on the changed files: gitleaks, yamllint, ruff format, shellcheck, REUSE, changelog lint, ansible-lint, Conventional Commit, Assisted-by; ansible-test sanity (pre-push) passed.
  • python3 -m unittest discover -s tests/scripts: 273 tests OK, including the real ansible-galaxy build in test_real_build_passes.
  • The selector picks all 19 scenarios for this diff.
  • molecule 26.11.0: the base config is found through find_vcs_root from both roles/<role> and the repo root, and the merged config for a role scenario has prerun: false, gathering: smart, forks: 50 kept.
  • Reviewed by a separate agent against molecule and ansible-compat source: prerun's other steps (requirements files, galaxy.yml dependencies) are already covered by the ci image or the slow path; no scenario has a requirements.yml; no play relies on facts re-gathered after a host change.

Not verified

  • A Molecule run: Molecule runs only in CI; this pull request's run is the test (expected: no collection install step per scenario).
  • scripts/check_scenarios_load_checkout.py builds molecule's config without the base config. That is harmless today (the base config sets nothing in the environment), but it would miss an env setting added to the shared file later; left for a follow-up.

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

Assisted-by: Claude Code

## What and why Closes #421 Adds a shared Molecule base config, `.config/molecule/config.yml`, which molecule merges under every scenario's `molecule.yml`: - `prerun: false`: `scripts/run_molecule_in_ci_image.sh` already puts the checkout first on `ANSIBLE_COLLECTIONS_PATH`, so molecule's per-scenario `--force` reinstall of `mortis.kamino` into each scenario's `ANSIBLE_HOME` is redundant. The collections it would also install come from the ci image's `/opt/collections`, or from the slow path's pinned install when the pins differ. - `gathering: smart`: each host's facts are gathered once per playbook run instead of in every play. `.config` goes on `build_ignore` (otherwise `scripts/check_tarball.py` fails Build). The Molecule rule in `.gitea/workflows/AGENTS.md` and the comments in `scripts/run_molecule_scenarios.sh` and `scripts/run_molecule_in_ci_image.sh` now describe the new behaviour. The new file selects every scenario, because scenarios read it, so it is not on the selector's IGNORED list; this pull request's own Molecule run is its test. No changelog fragment: CI only. ## Verified - `reuse lint`: compliant; the new file is covered by `path = "**"`. - Commit hooks on the changed files: gitleaks, yamllint, ruff format, shellcheck, REUSE, changelog lint, ansible-lint, Conventional Commit, Assisted-by; `ansible-test sanity` (pre-push) passed. - `python3 -m unittest discover -s tests/scripts`: 273 tests OK, including the real `ansible-galaxy` build in `test_real_build_passes`. - The selector picks all 19 scenarios for this diff. - molecule 26.11.0: the base config is found through `find_vcs_root` from both `roles/<role>` and the repo root, and the merged config for a role scenario has `prerun: false`, `gathering: smart`, `forks: 50` kept. - Reviewed by a separate agent against molecule and ansible-compat source: prerun's other steps (requirements files, galaxy.yml dependencies) are already covered by the ci image or the slow path; no scenario has a `requirements.yml`; no play relies on facts re-gathered after a host change. ## Not verified - A Molecule run: Molecule runs only in CI; this pull request's run is the test (expected: no collection install step per scenario). - `scripts/check_scenarios_load_checkout.py` builds molecule's config without the base config. That is harmless today (the base config sets nothing in the environment), but it would miss an env setting added to the shared file later; left for a follow-up. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added 1 commit 2026-11-27 15:37:29 +00:00
ci: share a Molecule base config with prerun off and smart gathering
Build / build (pull_request) Successful in 50s
Lint / lint (pull_request) Successful in 5m11s
Molecule / molecule (pull_request) Canceled after 16m59s
7d11d23294
Add .config/molecule/config.yml, which molecule merges under every
scenario's molecule.yml. prerun is off: the CI wrapper already puts the
checkout first on ANSIBLE_COLLECTIONS_PATH, so molecule's per-scenario
reinstall of mortis.kamino into ANSIBLE_HOME is redundant. gathering is
smart, so each host's facts are gathered once per playbook run instead
of in every play.

Add .config to build_ignore so scripts/check_tarball.py does not fail
the build, and reword the Molecule rule and the two script comments that
said molecule installs the collection into each scenario's ANSIBLE_HOME.

Assisted-by: Claude Code:claude-opus-5-5
CODEOWNERS rules requested review from Defame1297 2026-11-27 15:37:29 +00:00
Some required checks failed
Build / build (pull_request) Successful in 50s
Required
Details
Lint / lint (pull_request) Successful in 5m11s
Required
Details
Molecule / molecule (pull_request) Canceled after 16m59s
Required
Details
Some required checks were not successful.
This pull request has official review requests.
This pull request is blocked because it's outdated.
You are not authorized to merge this pull request.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ci/molecule-shared-config:ci/molecule-shared-config
git checkout ci/molecule-shared-config
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#444