diff --git a/.gitea/workflows/molecule.yml b/.gitea/workflows/molecule.yml index c8fe3a9..6aa4327 100644 --- a/.gitea/workflows/molecule.yml +++ b/.gitea/workflows/molecule.yml @@ -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