From 1065dec7973a28d3814464902c0b32ea45a6dfac Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Fri, 2 Aug 2024 09:22:58 +0200 Subject: [PATCH] Test 2 major ansible versions We keep testing Ansible 8.x in CentOS Stream 9, while we start testing Ansible 9.x in ubuntu and debian. This is mainly because in CentOS Stream 9 we have Python 3.9 but Ansible 9 requires at least Python 3.10. Change-Id: If2fcae6eb3d00a7488fd237ae155c337c0747e20 --- releasenotes/notes/ansible9-26b181a8ca5716cf.yaml | 4 ++++ scripts/env-setup.sh | 8 ++++++-- tox.ini | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/ansible9-26b181a8ca5716cf.yaml diff --git a/releasenotes/notes/ansible9-26b181a8ca5716cf.yaml b/releasenotes/notes/ansible9-26b181a8ca5716cf.yaml new file mode 100644 index 000000000..5b7e0d29c --- /dev/null +++ b/releasenotes/notes/ansible9-26b181a8ca5716cf.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Start testing and supporting Ansible 9.x in parallel with Ansible 8.x diff --git a/scripts/env-setup.sh b/scripts/env-setup.sh index 12ac839c2..663338c68 100755 --- a/scripts/env-setup.sh +++ b/scripts/env-setup.sh @@ -5,8 +5,12 @@ set -euo pipefail . $(dirname $0)/install-deps.sh # NOTE(pas-ha) the above exports some useful variables like # $PYTHON , $PIP and $VENV depending on venv install or not - -DEFAULT_PIP_ANSIBLE='>=8,<9' +source /etc/os-release +if [[ $ID == "centos" ]] || [[ $VERSION_CODENAME == "bullseye" ]]; then + DEFAULT_PIP_ANSIBLE='>=8,<9' +elif [[ $ID == "ubuntu" ]] || [[ $VERSION_CODENAME == "bookworm" ]] ; then + DEFAULT_PIP_ANSIBLE='>=9,<10' +fi ANSIBLE_COLLECTIONS_REQ=${ANSIBLE_COLLECTIONS_REQ:-$(dirname $0)/../ansible-collections-requirements.yml} ANSIBLE_COLLECTION_SOURCE_PATH= diff --git a/tox.ini b/tox.ini index 3c5149c54..39979a581 100644 --- a/tox.ini +++ b/tox.ini @@ -79,8 +79,8 @@ filename = *.py [testenv:linters] allowlist_externals = bash deps = - ansible>=8,<9 - ansible-lint>=6,<7 + ansible>=9,<10 + ansible-lint>=24,<25 commands = bash tools/ansible-lint.sh