File tree Expand file tree Collapse file tree 3 files changed +46
-15
lines changed
Expand file tree Collapse file tree 3 files changed +46
-15
lines changed Original file line number Diff line number Diff line change 1818 state : " absent"
1919 when : python_packages_remove|default([])|length > 0
2020
21- - name : " install additional python versions, if requested"
21+ - name : " install additional (legacy) python versions, if requested"
2222 apt :
2323 pkg :
2424 - " python{{item}}"
2727 - " python{{item}}-venv"
2828 state : " latest"
2929 with_items : " {{python_versions}}"
30+ when : item|float < 3.12
31+
32+ - name : " install additional python versions, if requested"
33+ apt :
34+ pkg :
35+ - " python{{item}}"
36+ - " python{{item}}-dev"
37+ - " python{{item}}-venv"
38+ state : " latest"
39+ with_items : " {{python_versions}}"
40+ when : item|float >= 3.12
Original file line number Diff line number Diff line change 11---
2- - name : " Fetch the pip install script"
3- get_url :
4- dest : " /tmp/get-pip.py"
5- url : " {{get_pip_url}}"
6-
7- - name : " install pip"
8- command : python3 /tmp/get-pip.py
9- args :
10- creates : " {{python_pip_location}}"
11-
12- - name : " update setuptools"
13- pip :
14- name : " setuptools{% if python_setuptools_version is defined %}=={{python_setuptools_version}}{% endif %}"
15- state : present
2+ - name : " install pip the old way"
3+ block :
4+ - name : " Fetch the pip install script"
5+ get_url :
6+ dest : " /tmp/get-pip.py"
7+ url : " {{get_pip_url}}"
8+
9+ - name : " install pip"
10+ command : python3 /tmp/get-pip.py
11+ args :
12+ creates : " {{python_pip_location}}"
13+
14+ - name : " update setuptools"
15+ pip :
16+ name : " setuptools{% if python_setuptools_version is defined %}=={{python_setuptools_version}}{% endif %}"
17+ state : present
18+
19+ when : ansible_lsb.id == "Ubuntu" and ansible_lsb.major_release|int < 20
20+
21+ - name : " install pip the new way"
22+ apt :
23+ pkg : " python3-pip"
24+ state : " latest"
25+ when : ansible_lsb.id == "Ubuntu" and ansible_lsb.major_release|int >= 20
Original file line number Diff line number Diff line change 1+ ---
2+ python_packages_add :
3+ - " python3"
4+ - " python3-dev"
5+ - " python3-venv"
6+ - " virtualenv"
7+
8+ python_packages_remove :
9+ - " python2.7"
10+ - " python2.7-dev"
You can’t perform that action at this time.
0 commit comments