From 4df98c0df4c839879c3eb801523ca36869bd87ad Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 25 Sep 2026 13:41:00 +0100 Subject: [PATCH] ansible: install Python 3.12 on RHEL 9 machines System Python (3.9) is too old for Node.js' scripts. For the test machines, newer Python 3 was installed in tap2junit set up, but we do not install tap2junit on the release machines. Install Python 3.12 as a virtualenv as part of baselayout, but do not replace `/usr/bin/python3` so it continues to point to system Python 3.9 and not break dnf. Signed-off-by: Richard Lau --- .../roles/baselayout/tasks/partials/repo/rhel9.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ansible/roles/baselayout/tasks/partials/repo/rhel9.yml b/ansible/roles/baselayout/tasks/partials/repo/rhel9.yml index f2daeed88..16779c860 100644 --- a/ansible/roles/baselayout/tasks/partials/repo/rhel9.yml +++ b/ansible/roles/baselayout/tasks/partials/repo/rhel9.yml @@ -12,3 +12,14 @@ ansible.builtin.dnf: name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm state: present + +- name: install Python 3.12 + ansible.builtin.dnf: + name: ['python3.12','python3.12-pip'] + state: present + notify: package updated + +- name: create Python virtual environment + ansible.builtin.command: + cmd: python3.12 -m venv /home/{{ server_user }}/venv + creates: /home/{{ server_user }}/venv/bin/python3.12