diff --git a/.github/scripts/ansible_cache.sh b/.github/scripts/ansible_cache.sh index a59863c..cff5ac1 100644 --- a/.github/scripts/ansible_cache.sh +++ b/.github/scripts/ansible_cache.sh @@ -2,7 +2,7 @@ # .github/scripts/ansible_cache.sh # Creates symlinks for attaching an external cache folder for Ansible. -# Separate folders for Roles, and Collections are maintained. +# Separate folders for Ansible-Compat, and Molecule are maintained. # 1: The absolute path of the mount point of the external cache folder. # 2: The absolute path of the usage point of the cache on the system. @@ -16,9 +16,17 @@ main () { MOUNT_FOLDER="${1}" USAGE_FOLDER="${2}" - mkdir -p "${MOUNT_FOLDER}" + mkdir -p "${MOUNT_FOLDER}/ansible-compat" + mkdir -p "${MOUNT_FOLDER}/molecule" - ln -sf "${MOUNT_FOLDER}" "${USAGE_FOLDER}" + mkdir -p "${USAGE_FOLDER}" + + ln -sf "${MOUNT_FOLDER}/ansible-compat" "${USAGE_FOLDER}/ansible-compat" + ln -sf "${MOUNT_FOLDER}/molecule" "${USAGE_FOLDER}/molecule" + + echo "Cache Symlinks Created:" + echo "${MOUNT_FOLDER}/ansible-compat -> ${USAGE_FOLDER}/ansible-compat" + echo "${MOUNT_FOLDER}/molecule -> ${USAGE_FOLDER}/molecule" } diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a815ed2..398950c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -196,11 +196,8 @@ jobs: run: | mkdir -p ~/.cache/pypoetry/virtualenvs/ source ./role/.github/scripts/ansible_cache.sh \ - "$(pwd)/ansible_cache/ansible-compat" \ - ~/.cache/ansible-compat - source ./role/.github/scripts/ansible_cache.sh \ - "$(pwd)/ansible_cache/molecule" \ - ~/.cache/molecule + "$(pwd)/ansible_cache" \ + ~/.cache - name: Molecule Lint -- Mount Ansible Cache uses: actions/cache@v3 @@ -270,11 +267,8 @@ jobs: run: | mkdir -p ~/.cache/pypoetry/virtualenvs source ./role/.github/scripts/ansible_cache.sh \ - "$(pwd)/ansible_cache/ansible-compat" \ - ~/.cache/ansible-compat - source ./role/.github/scripts/ansible_cache.sh \ - "$(pwd)/ansible_cache/molecule" \ - ~/.cache/molecule + "$(pwd)/ansible_cache" \ + ~/.cache - name: OSX Build -- Mount Ansible Cache uses: actions/cache@v3