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
This commit is contained in:
Defame1297 committed 2026-11-27 15:20:18 +00:00
1 parent 6e3ea4521b
commit 7d11d23294
5 files changed
+18 -6

No files matched your search

+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