Skip to content
Snippets Groups Projects
Commit 1555132d authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

utils/run-tests.sh: Install Ansible collections on virtual environment

When runing tests using 'utils/run-tests.sh' from inside an existing
Python virtual environment the Ansible collections are not installed due
to the order of execution of the script. On a machine that does not have
the 'containers.*' collection the test fails as there is no container
connector available.

This patch moves the section that installs Ansible collections to run
after the virtual environment is configured, and then install the
collections (usually, only 'containers.podman'), allowing the tests to
be executed.
parent dab64c7c
No related branches found
No related tags found
No related merge requests found
...@@ -259,6 +259,10 @@ then ...@@ -259,6 +259,10 @@ then
log info "Installing Ansible: ${ANSIBLE_VERSION}" log info "Installing Ansible: ${ANSIBLE_VERSION}"
pip install --quiet "${ANSIBLE_VERSION}" pip install --quiet "${ANSIBLE_VERSION}"
log debug "Ansible version: $(ansible --version | sed -n "1p")${RST}" log debug "Ansible version: $(ansible --version | sed -n "1p")${RST}"
else
log info "Using current virtual environment."
fi
if [ -n "${ANSIBLE_COLLECTIONS}" ] if [ -n "${ANSIBLE_COLLECTIONS}" ]
then then
log warn "Installed collections will not be removed after execution." log warn "Installed collections will not be removed after execution."
...@@ -266,9 +270,6 @@ then ...@@ -266,9 +270,6 @@ then
# shellcheck disable=SC2086 # shellcheck disable=SC2086
quiet ansible-galaxy collection install ${ANSIBLE_COLLECTIONS} || die "Failed to install Ansible collections." quiet ansible-galaxy collection install ${ANSIBLE_COLLECTIONS} || die "Failed to install Ansible collections."
fi fi
else
log info "Using current virtual environment."
fi
# Ansible configuration # Ansible configuration
export ANSIBLE_ROLES_PATH="${TOPDIR}/roles" export ANSIBLE_ROLES_PATH="${TOPDIR}/roles"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment