Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions ansible/deploy-openstack-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,22 @@
become: true
when: ansible_facts['distribution'] == "Ubuntu"

- name: Set a fact about the Python binary to use
ansible.builtin.set_fact:
python_binary: "{{ '/usr/bin/python3.12' if ansible_facts['distribution'] == 'Rocky' and (openstack_release.stdout.startswith('master') or openstack_release.stdout.startswith('2025')) else '/usr/bin/python3' }}"

- name: Ensure python3.12 is installed (Rocky)
ansible.builtin.package:
name: python3.12
state: present
become: true
when: python_binary == '/usr/bin/python3.12'

- name: Ensure the latest version of pip is installed
ansible.builtin.pip:
name: pip
virtualenv: "{{ ansible_env.HOME }}/venvs/kayobe"
virtualenv_command: "/usr/bin/python3 -m venv"
virtualenv_command: "{{ python_binary }} -m venv"
state: latest

- name: Fix up `kayobe-config` requirements to point to requested version
Expand All @@ -280,7 +291,7 @@
ansible.builtin.pip:
requirements: "{{ src_directory }}/{{ kayobe_config_name }}/requirements.txt"
virtualenv: "{{ ansible_env.HOME }}/venvs/kayobe"
virtualenv_command: "/usr/bin/python3 -m venv"
virtualenv_command: "{{ python_binary }} -m venv"
state: present

- name: Ensure `kayobe` is installed (Yoga & earlier)
Expand Down