Compare commits

...
Author SHA1 Message Date
Defame1297 7d11d23294 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
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
2026-11-27 15:20:18 +00:00
5 changed files with 18 additions and 6 deletions

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
---
# Merged under every scenario's molecule.yml. prerun off: the CI wrapper puts this checkout
# first on ANSIBLE_COLLECTIONS_PATH, so molecule's per-scenario install is unused.
prerun: false
provisioner:
config_options:
defaults:
# Gather each host's facts once per playbook run, not in every play.
gathering: smart
+4 -3
View File
@@ -85,9 +85,10 @@ issue.
- **A role named in an include, import, play `roles:` entry or meta dependency is written out in
full**, never bare or templated. *Why:* the selector finds dependent roles by their FQCN.
*Held:* control: a selector test fails a bare or templated name.
- **Scenarios load `mortis.kamino` from the checkout, never from molecule's installed copy, so
`galaxy.yml` is on IGNORED.** *Why:* molecule installs the collection from `galaxy.yml` into
each scenario's `ANSIBLE_HOME`, which is not on `ANSIBLE_COLLECTIONS_PATH`, so its changes
- **Scenarios load `mortis.kamino` from the checkout, never from an installed copy, so
`galaxy.yml` is on IGNORED.** *Why:* the checkout is first on `ANSIBLE_COLLECTIONS_PATH` and the
shared base config `.config/molecule/config.yml` turns off molecule's install of the collection
(`prerun: false`), so changes to `galaxy.yml`
(release versions, `build_ignore`) do not change what a scenario runs, and the Build check
proves the collection builds; they had caused about a third of full pull request runs and their
minutes (#338). *Held:* control: `scripts/check_scenarios_load_checkout.py`, which
+1
View File
@@ -39,6 +39,7 @@ build_ignore:
- apm_modules
- .apm-local
- .claude
- .config
- .gitea
- .gitignore
- .pre-commit-config.yaml
+2 -2
View File
@@ -29,8 +29,8 @@ else
fi
ansible --version
molecule --version
# The collection under test first; molecule also installs it into each scenario's ANSIBLE_HOME,
# which the run script keeps in the job tree.
# The collection under test first; molecule does not install it again (prerun is off in
# .config/molecule/config.yml).
export ANSIBLE_COLLECTIONS_PATH="$AC_ROOT:${extra_collections}/opt/collections"
# Facts are not injected as variables (deprecated in ansible-core 2.22, removal scheduled for 2.24, see #364), so a
# role that reads a bare `ansible_<fact>` fails its scenario here instead of in a consumer's inventory.
+2 -1
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# The Molecule workflow's "Run the scenarios" step: `molecule test` for each scenario directory on
# stdin, MOLECULE_LANES (default 4) at a time, each with its own log and ANSIBLE_HOME under
# <work-dir>/<n>/ (molecule reinstalls the collection there with --force). Exit 1 on a failure.
# <work-dir>/<n>/ (no collection is installed there: .config/molecule/config.yml sets prerun false).
# Exit 1 on a failure.
#
# scripts/run_molecule_scenarios.sh <work-dir> < scenario-dirs
set -euo pipefail