fix(molecule): satisfy yamllint and shellcheck, and keep molecule's collection install job-local
yamllint line-length on the MOLECULE_IMAGE value (166 > 160) and shellcheck SC2155 on the export. And: the first run showed molecule installing the collection under test into the runner user's ~/.ansible/collections and warning about the duplicate in the job tree. That copy outlives the job and the version stays 0.1.0, so a later run could resolve a stale one. ANSIBLE_HOME now points into the job tree, and a copy left by earlier runs is removed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
29278e9625
commit
0211a63923
1 file changed
+11
-3
@@ -63,7 +63,8 @@ jobs:
|
||||
MOLECULE_COLLECTIONS: /opt/molecule-collections
|
||||
# Used by the scenarios as `image: ${MOLECULE_IMAGE}`; set it the same way to run
|
||||
# one locally.
|
||||
MOLECULE_IMAGE: git.rkdr.net/mortis/molecule-ubuntu2404:0.1.0@sha256:80dbfa7f88309072e954ae20e80ee8171bd750abc7c1d9563c746bf6f0121f04
|
||||
MOLECULE_IMAGE: >-
|
||||
git.rkdr.net/mortis/molecule-ubuntu2404:0.1.0@sha256:80dbfa7f88309072e954ae20e80ee8171bd750abc7c1d9563c746bf6f0121f04
|
||||
steps:
|
||||
# Provisioned by the gitea_runner role (install_services); fail with a clear
|
||||
# message when this runs before it has.
|
||||
@@ -96,8 +97,15 @@ jobs:
|
||||
run: |
|
||||
# molecule calls ansible-config and ansible-playbook by name
|
||||
export PATH="$MOLECULE_VENV/bin:$PATH"
|
||||
# the collection under test first, then what the roles use
|
||||
export ANSIBLE_COLLECTIONS_PATH="$(cd ../../.. && pwd):$MOLECULE_COLLECTIONS"
|
||||
# The collection under test first, then what the roles use. molecule also
|
||||
# installs the collection under test into ANSIBLE_HOME; keep that inside the
|
||||
# job tree so no run resolves a copy another run left in the runner user's
|
||||
# home (the version stays 0.1.0, so a stale copy would look current). The rm
|
||||
# clears a copy left there by runs before this was set.
|
||||
ac_root="$(cd ../../.. && pwd)"
|
||||
export ANSIBLE_HOME="$ac_root/.ansible"
|
||||
export ANSIBLE_COLLECTIONS_PATH="$ac_root:$MOLECULE_COLLECTIONS"
|
||||
rm -rf "$HOME/.ansible/collections/ansible_collections/mortis"
|
||||
failed=""
|
||||
ran=0
|
||||
for cfg in extensions/molecule/*/molecule.yml; do
|
||||
|
||||
Reference in new issue
Block a user