c12s-kubespray/tests/scripts/testcases_prepare.sh
Cristian Calin 0d0468e127
Exercise multiple ansible versions in CI (#8172)
* Ansible: separate requirements files for supported ansible versions

* Ansible: allow using ansible 2.11

* CI: Exercise Ansible 2.9 and Ansible 2.11 in a basic AIO CI job

* CI: Allow running a reset test outside of idempotency tests and running it in stage1

* CI: move ubuntu18-calico-aio job to stage2 and relay only on ubuntu20 with the variously supported ansible versions for stage1

* CI: add capability to install collections or roles from ansible-galaxy to mitigate missing behavior in older ansible versions
2021-11-10 16:11:50 -08:00

18 lines
670 B
Bash
Executable file

#!/bin/bash
set -euxo pipefail
: ${ANSIBLE_MAJOR_VERSION:=2.10}
/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