Perform upgrade by default when installing ansible

We don't upgrade ansible in the upgrade jobs because the requirement is
already satisfied according to pip.
Although, we should upgrade ansible as it may differ between releases.
Also perform a clean install if ansible is already present to avoid
conflicts.

Change-Id: I3cb1059408ef069001cde91474c68768315ff784
This commit is contained in:
Riccardo Pittau 2021-07-12 14:33:57 +02:00
parent 43062e2fe7
commit 645ac1ca5f
1 changed files with 5 additions and 1 deletions

View File

@ -21,8 +21,12 @@ BIFROST_COLLECTIONS_PATHS=${ANSIBLE_COLLECTIONS_PATHS:-}
PLAYBOOKS_LIBRARY_PATH=$(dirname $0)/../playbooks/library
echo "Installing/upgrading Ansible"
${PIP} install "${ANSIBLE_SOURCE_PATH}"
ANSIBLE=${VENV}/bin/ansible
if [ -f "$ANSIBLE" ]; then
${PIP} uninstall -y ansible
fi
${PIP} install "${ANSIBLE_SOURCE_PATH}"
ANSIBLE_GALAXY=${VENV}/bin/ansible-galaxy
if [[ -z $BIFROST_COLLECTIONS_PATHS ]]; then
echo "Setting ANSIBLE_COLLECTIONS_PATHS to virtualenv"