c12s-kubespray/tests/scripts/testcases_prepare.sh
Kenichi Omichi f184725c5f
Use ansible 2.12 for testcases_prepare (#8763)
tests/requirements.txt links to tests/requirements-2.12.txt, so
Kubespray uses ansible 2.12 by default for testing. However we
forgot to update testcases_prepare.sh to use ansible 2.12.
This updates testcases_prepare to use ansible 2.12.
2022-05-02 11:34:31 -07:00

18 lines
670 B
Bash
Executable file

#!/bin/bash
set -euxo pipefail
: ${ANSIBLE_MAJOR_VERSION:=2.12}
/usr/bin/python -m pip uninstall -y ansible ansible-base ansible-core
/usr/bin/python -m pip install -r tests/requirements-${ANSIBLE_MAJOR_VERSION}.txt
mkdir -p /.ssh
mkdir -p cluster-dump
mkdir -p $HOME/.ssh
ansible-playbook --version
# in some cases we may need to bring in collections or roles from ansible-galaxy
# to compensate for missing functionality in older ansible versions
if [ -f requirements-${ANSIBLE_MAJOR_VERSION}.yml ] ; then
ansible-galaxy role install -r requirements-${ANSIBLE_MAJOR_VERSION}.yml
ansible-galaxy collection install -r requirements-${ANSIBLE_MAJOR_VERSION}.yml
fi