ci: turn on Ansible pipelining for Molecule scenarios #446
No files matched your search
@@ -0,0 +1,13 @@
|
||||
---
|
||||
# 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:
|
||||
connection:
|
||||
# Pipe each module over stdin: without it every task pays extra docker exec and docker cp
|
||||
# calls to make a temp dir, copy the module in and clean up.
|
||||
pipelining: true
|
||||
defaults:
|
||||
# Gather each host's facts once per playbook run, not in every play.
|
||||
gathering: smart
|
||||
@@ -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
|
||||
|
||||
@@ -39,6 +39,7 @@ build_ignore:
|
||||
- apm_modules
|
||||
- .apm-local
|
||||
- .claude
|
||||
- .config
|
||||
- .gitea
|
||||
- .gitignore
|
||||
- .pre-commit-config.yaml
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user