diff --git a/ansible/kayobe-ansible-user.yml b/ansible/kayobe-ansible-user.yml index c54aa703f..bcf170621 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,14 @@ 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 + 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 %}" tags: - - kayobe-ansible-user - ensure-python tasks: - name: Check if python is installed @@ -62,11 +62,26 @@ 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 + 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: 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 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 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.