Skip to content

Commit ab8c0ee

Browse files
committed
Add python3.12 related script and playbook
1 parent b771fca commit ab8c0ee

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
- name: Install Python 3.12 to hosts
2+
hosts: all
3+
become: true
4+
tasks:
5+
- name: Install Python 3.12
6+
ansible.builtin.dnf:
7+
name: python3.12
8+
state: latest
9+
10+
- name: Edit symlinks to make Python 3.12 default (/usr/bin)
11+
ansible.builtin.file:
12+
src: /usr/bin/python3.12
13+
dest: /usr/bin/python3
14+
owner: root
15+
group: root
16+
state: link
17+
force: true
18+
19+
- name: Edit symlinks to make Python 3.12 default (/bin)
20+
ansible.builtin.file:
21+
src: /bin/python3.12
22+
dest: /bin/python3
23+
owner: root
24+
group: root
25+
state: link
26+
force: true
27+
28+
- name: Verify Python version
29+
ansible.builtin.command: python3 --version
30+
register: python_version
31+
32+
- name: Print Python version
33+
ansible.builtin.debug:
34+
var: python_version.stdout
35+
36+
- name: Ensure Python 3.12 pip
37+
ansible.builtin.command: python3 -m ensurepip
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../ansible/rocky9-python312.yml

tools/rocky9-python312.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
sudo dnf install -y python3.12
6+
sudo ln -sf /bin/python3.12 /bin/python3
7+
sudo ln -sf /usr/bin/python3.12 /usr/bin/python3
8+
9+
echo $(python3 --version)
10+
11+
sudo python3 -m ensurepip

0 commit comments

Comments
 (0)