Skip to content

Commit

Permalink
Merge pull request #1116 from rjeffman/fix_runtests_collections
Browse files Browse the repository at this point in the history
utils/run-tests.sh: Install Ansible collections on virtual environment
  • Loading branch information
t-woerner authored Jul 17, 2023
2 parents 411d363 + 1555132 commit fef1bdc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions utils/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,18 @@ then
log info "Installing Ansible: ${ANSIBLE_VERSION}"
pip install --quiet "${ANSIBLE_VERSION}"
log debug "Ansible version: $(ansible --version | sed -n "1p")${RST}"
if [ -n "${ANSIBLE_COLLECTIONS}" ]
then
log warn "Installed collections will not be removed after execution."
log none "Installing: Ansible Collection ${ANSIBLE_COLLECTIONS}"
# shellcheck disable=SC2086
quiet ansible-galaxy collection install ${ANSIBLE_COLLECTIONS} || die "Failed to install Ansible collections."
fi
else
log info "Using current virtual environment."
fi

if [ -n "${ANSIBLE_COLLECTIONS}" ]
then
log warn "Installed collections will not be removed after execution."
log none "Installing: Ansible Collection ${ANSIBLE_COLLECTIONS}"
# shellcheck disable=SC2086
quiet ansible-galaxy collection install ${ANSIBLE_COLLECTIONS} || die "Failed to install Ansible collections."
fi

# Ansible configuration
export ANSIBLE_ROLES_PATH="${TOPDIR}/roles"
export ANSIBLE_LIBRARY="${TOPDIR}/plugins:${TOPDIR}/molecule"
Expand Down

0 comments on commit fef1bdc

Please sign in to comment.