Skip to content

Commit 0b670fc

Browse files
committed
ansible: fix Python 3 set up on RHEL 9
Overwriting `/usr/bin/python3` on RHEL 9 breaks `subscription-manager` (but does not on RHEL 8). Instead create and use a Python 3.12 virtual environment for the CI.
1 parent e351a02 commit 0b670fc

File tree

2 files changed

+3
-14
lines changed
  • ansible/roles

2 files changed

+3
-14
lines changed

ansible/roles/baselayout/tasks/partials/repo/rhel9.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,3 @@
1212
ansible.builtin.dnf:
1313
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
1414
state: present
15-
16-
- name: install Python 3.12
17-
ansible.builtin.dnf:
18-
name: ['python3.12','python3.12-pip']
19-
state: present
20-
notify: package updated
21-
22-
- name: update python3 package alternatives
23-
community.general.alternatives:
24-
link: /usr/bin/python3
25-
name: python3
26-
path: /usr/bin/python3.12

ansible/roles/jenkins-worker/tasks/partials/tap2junit/rhel9.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
- name: install pip
88
ansible.builtin.dnf:
9-
name: python3-pip
9+
name: ['python3.12','python3.12-pip']
1010
state: present
1111

1212
- name: install tap2junit
1313
ansible.builtin.pip:
14-
executable: /usr/bin/pip3
1514
name: tap2junit=={{ tap2junit_version }}
1615
state: present
16+
virtualenv: /home/{{ server_user }}/venv
17+
virtualenv_command: python3.12 -m venv

0 commit comments

Comments
 (0)