Bump Ansible version installed in Kolla Ansible virtualenv

This change bumps up the versions of Ansible installed in the
kolla-ansible virtualenv to a maximum of 10.x (ansible-core 2.17.x) and
minimum to 9.x. This is to align with the Kolla version requirements
currently in master.

Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/921743
Change-Id: I4147a27ed04d28e832f11662e45dbae2851f63a8
This commit is contained in:
Will Szumski 2024-07-05 11:17:25 +01:00
parent c726492e49
commit dec43999f7
4 changed files with 20 additions and 5 deletions

View File

@ -16,7 +16,7 @@ kolla_ansible_source_version:
kolla_ansible_venv: "{{ ansible_facts.env['PWD'] }}/kolla-venv"
# Python interpreter to use to create Kolla Ansible virtualenv.
kolla_ansible_venv_python: /usr/bin/python3
kolla_ansible_venv_python: "{{ '/usr/bin/python3.12' if ansible_facts.os_family == 'RedHat' else '/usr/bin/python3' }}"
# Extra requirements to install inside the kolla-ansible virtualenv.
kolla_ansible_venv_extra_requirements: []
@ -26,7 +26,7 @@ kolla_ansible_venv_extra_requirements: []
# tested code. Changes to this limit should be tested. It is possible to only
# install ansible-core by setting kolla_ansible_venv_ansible to None.
kolla_ansible_venv_ansible:
kolla_ansible_venv_ansible_core: 'ansible-core>=2.15,<2.17'
kolla_ansible_venv_ansible_core: 'ansible-core>=2.16,<2.18'
# Path to a requirements.yml file for Ansible collections.
kolla_ansible_requirements_yml: "{{ kolla_ansible_venv }}/share/kolla-ansible/requirements.yml"

View File

@ -36,6 +36,15 @@
version: "{{ kolla_ansible_source_version }}"
when: kolla_ansible_ctl_install_type == 'source'
- name: Remove virtualenv if python version is stale
file:
path: "{{ kolla_ansible_venv }}"
state: absent
become: True
when:
- kolla_ansible_venv is not none
- (kolla_ansible_venv ~ '/bin/python') | realpath != kolla_ansible_venv_python | realpath
- name: Ensure virtualenv parent directory exists
file:
path: "{{ kolla_ansible_venv | dirname }}"
@ -97,7 +106,6 @@
{% endif %}
- "{{ kolla_ansible_venv_ansible_core }}"
- "{{ kolla_ansible_venv_ansible }}"
- selinux
pip:
name: "{{ (kolla_ansible_packages + kolla_ansible_venv_extra_requirements) | select | list }}"
state: latest

View File

@ -5,6 +5,7 @@ kolla_ansible_package_dependencies:
- git
- libffi-devel
- openssl-devel
- python3-devel
- python3-pip
- python3.12
- python3.12-devel
- python3.12-pyyaml
- rsync

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Updates the minimum supported version of Ansible from 2.15 to 2.16, and the
maximum supported version from 2.17 to 2.18 in the Kolla Ansible virtualenv.
The Python version used to install Kolla Ansible on Rocky 9 is bumped to 3.12.