mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 09:38:12 -03:30
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
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -euxo pipefail
|
||||
|
||||
/usr/bin/python -m pip uninstall -y ansible
|
||||
/usr/bin/python -m pip install -r tests/requirements.txt
|
||||
: ${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
|
||||
|
||||
@@ -86,27 +86,26 @@ ansible-playbook --limit "all:!fake_hosts" -e @${CI_TEST_VARS} ${CI_TEST_ADDITIO
|
||||
## Kubernetes conformance tests
|
||||
ansible-playbook -i ${ANSIBLE_INVENTORY} -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} --limit "all:!fake_hosts" tests/testcases/100_check-k8s-conformance.yml $ANSIBLE_LOG_LEVEL
|
||||
|
||||
## Idempotency checks 1/5 (repeat deployment)
|
||||
if [ "${IDEMPOT_CHECK}" = "true" ]; then
|
||||
## Idempotency checks 1/5 (repeat deployment)
|
||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_REGISTRY_MIRROR} ${CI_TEST_ADDITIONAL_VARS} -e @${CI_TEST_VARS} -e local_release_dir=${PWD}/downloads --limit "all:!fake_hosts" cluster.yml
|
||||
fi
|
||||
|
||||
## Idempotency checks 2/5 (Advanced DNS checks)
|
||||
if [ "${IDEMPOT_CHECK}" = "true" ]; then
|
||||
## Idempotency checks 2/5 (Advanced DNS checks)
|
||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} --limit "all:!fake_hosts" tests/testcases/040_check-network-adv.yml
|
||||
|
||||
if [ "${RESET_CHECK}" = "true" ]; then
|
||||
## Idempotency checks 3/5 (reset deployment)
|
||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} -e reset_confirmation=yes --limit "all:!fake_hosts" reset.yml
|
||||
|
||||
## Idempotency checks 4/5 (redeploy after reset)
|
||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} -e local_release_dir=${PWD}/downloads --limit "all:!fake_hosts" cluster.yml
|
||||
|
||||
## Idempotency checks 5/5 (Advanced DNS checks)
|
||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} --limit "all:!fake_hosts" tests/testcases/040_check-network-adv.yml
|
||||
fi
|
||||
fi
|
||||
|
||||
## Idempotency checks 3/5 (reset deployment)
|
||||
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
|
||||
# Clean up at the end, this is to allow stage1 tests to include cleanup test
|
||||
if [ "${RESET_CHECK}" = "true" ]; then
|
||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} -e reset_confirmation=yes --limit "all:!fake_hosts" reset.yml
|
||||
fi
|
||||
|
||||
## Idempotency checks 4/5 (redeploy after reset)
|
||||
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
|
||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} -e local_release_dir=${PWD}/downloads --limit "all:!fake_hosts" cluster.yml
|
||||
fi
|
||||
|
||||
## Idempotency checks 5/5 (Advanced DNS checks)
|
||||
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
|
||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} ${CI_TEST_ADDITIONAL_VARS} --limit "all:!fake_hosts" tests/testcases/040_check-network-adv.yml
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user