diff --git a/ansible/roles/kolla-ansible/defaults/main.yml b/ansible/roles/kolla-ansible/defaults/main.yml index 02cd4df75..340060844 100644 --- a/ansible/roles/kolla-ansible/defaults/main.yml +++ b/ansible/roles/kolla-ansible/defaults/main.yml @@ -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" diff --git a/ansible/roles/kolla-ansible/tasks/install.yml b/ansible/roles/kolla-ansible/tasks/install.yml index c1fdf1362..e227612ae 100644 --- a/ansible/roles/kolla-ansible/tasks/install.yml +++ b/ansible/roles/kolla-ansible/tasks/install.yml @@ -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 diff --git a/ansible/roles/kolla-ansible/vars/RedHat.yml b/ansible/roles/kolla-ansible/vars/RedHat.yml index cddc7b347..04f9a8455 100644 --- a/ansible/roles/kolla-ansible/vars/RedHat.yml +++ b/ansible/roles/kolla-ansible/vars/RedHat.yml @@ -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 diff --git a/releasenotes/notes/kolla-ansible-2.16-1.17-242ccf40a08100d0.yaml b/releasenotes/notes/kolla-ansible-2.16-1.17-242ccf40a08100d0.yaml new file mode 100644 index 000000000..31fdf7f51 --- /dev/null +++ b/releasenotes/notes/kolla-ansible-2.16-1.17-242ccf40a08100d0.yaml @@ -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.