From 1f7a2a22e57f32205c0cfe0f448bb9840f71ada6 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Sat, 7 Feb 2026 22:43:41 +0100 Subject: [PATCH 1/4] Split Python installation from user bootstrap The check for the absence of the Python interpreter cannot run with ansible_python_interpreter set to /usr/bin/python3. Change-Id: Ibab43c633cf718664e144470e944ef24425695fe Signed-off-by: Pierre Riteau (cherry picked from commit 981d63926c421a5a39bc2cf16394a5b668b94aba) --- ansible/kayobe-ansible-user.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/ansible/kayobe-ansible-user.yml b/ansible/kayobe-ansible-user.yml index c54aa703f..16e3e9851 100644 --- a/ansible/kayobe-ansible-user.yml +++ b/ansible/kayobe-ansible-user.yml @@ -36,8 +36,8 @@ attempting bootstrap when: ssh_result.unreachable | default(false) -- name: Ensure python is installed and the Kayobe Ansible user account exists - hosts: kayobe_user_bootstrap_required_True +- name: Ensure Python is installed + hosts: seed-hypervisor:seed:overcloud:infra-vms gather_facts: no max_fail_percentage: >- {{ kayobe_ansible_user_max_fail_percentage | @@ -46,14 +46,10 @@ default(100) }} vars: ansible_user: "{{ bootstrap_user }}" - # We can't assume that a virtualenv exists at this point, so use the system - # python interpreter. - ansible_python_interpreter: /usr/bin/python3 dnf_options: - "-y" - "{% if 'proxy' in dnf_config %}--setopt=proxy={{ dnf_config['proxy'] }}{% endif %}" tags: - - kayobe-ansible-user - ensure-python tasks: - name: Check if python is installed @@ -67,6 +63,22 @@ raw: "test -e /usr/bin/apt && (sudo apt -y update && sudo apt install -y python3-minimal) || (sudo dnf {{ dnf_options | select | join(' ') }} install python3)" when: check_python.rc != 0 +- name: Ensure the Kayobe Ansible user account exists + hosts: kayobe_user_bootstrap_required_True + gather_facts: no + max_fail_percentage: >- + {{ kayobe_ansible_user_max_fail_percentage | + default(host_configure_max_fail_percentage) | + default(kayobe_max_fail_percentage) | + default(100) }} + vars: + ansible_user: "{{ bootstrap_user }}" + # We can't assume that a virtualenv exists at this point, so use the system + # python interpreter. + ansible_python_interpreter: /usr/bin/python3 + tags: + - kayobe-ansible-user + tasks: - import_role: name: singleplatform-eng.users vars: From 907ceba3a4a73d5d82cbe45bc2719934746a2bc8 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Tue, 17 Feb 2026 21:50:32 +0100 Subject: [PATCH 2/4] Support Python installation through Apt proxy Change-Id: Ib2f9c10433c42f783e1d5f618291ba5cb7be1641 Signed-off-by: Pierre Riteau (cherry picked from commit 8b36acddab1fc16c35ef86852c6a816da3617546) --- ansible/kayobe-ansible-user.yml | 9 ++++++--- .../notes/bootstrap-apt-proxy-bb121cf577eaeba4.yaml | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/bootstrap-apt-proxy-bb121cf577eaeba4.yaml diff --git a/ansible/kayobe-ansible-user.yml b/ansible/kayobe-ansible-user.yml index 16e3e9851..bcf170621 100644 --- a/ansible/kayobe-ansible-user.yml +++ b/ansible/kayobe-ansible-user.yml @@ -46,6 +46,10 @@ default(100) }} vars: ansible_user: "{{ bootstrap_user }}" + apt_options: + - "-y" + - "{% if apt_proxy_http %}-o Acquire::http::proxy='{{ apt_proxy_http }}'{% endif %}" + - "{% if apt_proxy_https %}-o Acquire::https::proxy='{{ apt_proxy_https }}'{% endif %}" dnf_options: - "-y" - "{% if 'proxy' in dnf_config %}--setopt=proxy={{ dnf_config['proxy'] }}{% endif %}" @@ -58,9 +62,8 @@ failed_when: false register: check_python - # TODO(priteau): Support apt proxy - - name: Ensure python is installed - raw: "test -e /usr/bin/apt && (sudo apt -y update && sudo apt install -y python3-minimal) || (sudo dnf {{ dnf_options | select | join(' ') }} install python3)" + - name: Ensure Python is installed + raw: "(test -e /usr/bin/apt && sudo apt {{ apt_options | select | join(' ') }} update && sudo apt install {{ apt_options | select | join(' ') }} python3-minimal) || (test -e /usr/bin/dnf && sudo dnf {{ dnf_options | select | join(' ') }} install python3)" when: check_python.rc != 0 - name: Ensure the Kayobe Ansible user account exists diff --git a/releasenotes/notes/bootstrap-apt-proxy-bb121cf577eaeba4.yaml b/releasenotes/notes/bootstrap-apt-proxy-bb121cf577eaeba4.yaml new file mode 100644 index 000000000..5ed203141 --- /dev/null +++ b/releasenotes/notes/bootstrap-apt-proxy-bb121cf577eaeba4.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Adds support for bootstrapping Python on Ubuntu through a proxy. From 5dd2eb9bf99e2e420853ea4ed27f6f5c3fd58b25 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Wed, 11 Mar 2026 18:15:57 +0100 Subject: [PATCH 3/4] [2025.1] Pin setuptools in tox docs job setuptools 82.0.0 removed pkg_resources, breaking stable/2025.1 jobs. Use a temporary stable-only pin to setuptools==81.0.0. Detail reasoning in [1]. [1] https://review.opendev.org/c/openstack/requirements/+/976227 Change-Id: If9a1842173e69145914f5d1ca6a4485e8910c258 Signed-off-by: Pierre Riteau --- doc/requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/requirements.txt b/doc/requirements.txt index 51a2c6498..33ba4efa0 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -7,3 +7,6 @@ reno>=3.1.0 # Apache-2.0 sphinx>=2.0.0,!=2.1.0 # BSD sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD whereto>=0.3.0 # Apache-2.0 +# NOTE(priteau): pin setuptools +# https://setuptools.pypa.io/en/stable/history.html#v82-0-0 +setuptools==81.0.0 From 05e0c3b4b0869833d49c9c2bc954ac0ac6742837 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Wed, 11 Mar 2026 21:26:44 +0100 Subject: [PATCH 4/4] [2025.1] Document requirement for Python 3.12 Change-Id: I1dbfb45e6a01b144a55db17c9aac4bf3fa30b128 Signed-off-by: Pierre Riteau --- doc/source/installation.rst | 18 +++++++++++++++--- doc/source/support-matrix.rst | 7 ++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 2da16aacd..bd071b7ca 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -15,9 +15,9 @@ Prerequisites Currently Kayobe supports the following Operating Systems on the Ansible control host: -- CentOS Stream 9 (since Zed 13.0.0 release) +- CentOS Stream 9 (since Zed 13.0.0 release), using Python 3.12 - CentOS Stream 10 (since Epoxy 18.3.0 release) -- Rocky Linux 9 (since Zed 13.0.0 release) +- Rocky Linux 9 (since Zed 13.0.0 release), using Python 3.12 - Rocky Linux 10 (since Epoxy 18.3.0 release) - Ubuntu Noble 24.04 (since Dalmatian 17.0.0 release) @@ -30,10 +30,14 @@ it is recommended to install Kayobe in a virtualenv. Ensure that the necessary to install the GCC compiler chain in order to build the extensions of some of kayobe's python dependencies. -On CentOS/Rocky:: +On CentOS Stream/Rocky Linux 10:: $ dnf install -y python3-devel gcc libffi-devel +On CentOS Stream/Rocky Linux 9:: + + $ dnf install -y python3.12-devel gcc libffi-devel + On Ubuntu:: $ apt install -y python3-dev gcc libffi-dev python3-venv @@ -99,6 +103,10 @@ Create a virtualenv for Kayobe:: $ python3 -m venv /venvs/kayobe +Or, using Python 3.12 on CentOS Stream/Rocky Linux 9:: + + $ python3.12 -m venv /venvs/kayobe + Activate the virtualenv and update pip:: $ source /venvs/kayobe/bin/activate @@ -140,6 +148,10 @@ Create a virtualenv for Kayobe:: $ python3 -m venv /venvs/kayobe +Or, using Python 3.12 on CentOS Stream/Rocky Linux 9:: + + $ python3.12 -m venv /venvs/kayobe + Activate the virtualenv and update pip:: $ source /venvs/kayobe/bin/activate diff --git a/doc/source/support-matrix.rst b/doc/source/support-matrix.rst index 78ab21e1d..11dd5b4b7 100644 --- a/doc/source/support-matrix.rst +++ b/doc/source/support-matrix.rst @@ -9,7 +9,7 @@ Supported Operating Systems Kayobe supports the following host Operating Systems (OS): -* Rocky Linux 9 (since Zed 13.0.0 release) +* Rocky Linux 9 (since Zed 13.0.0 release), using Python 3.12 * Rocky Linux 10 (since Epoxy 18.3.0 release) * Ubuntu Noble 24.04 (since Dalmatian 17.0.0 release) @@ -17,6 +17,11 @@ In addition to that CentOS Stream 9/10 host OS is functional, but not officially supported. Kolla does not publish CentOS Stream 9/10 images to Docker Hub/Quay.io, therefore users need to build them by themselves. +.. note:: + + This release of Kayobe requires Python 3.10 or above. On CentOS Stream 9 or + Rocky Linux 9, use Python 3.12 instead of the default Python 3.9. + .. note:: CentOS Stream 9 is no longer supported as a host OS beyond the Epoxy