Skip to content

Commit 5c774a3

Browse files
authored
Merge pull request #16 from Appsilon/chore/update-python-installation-for-ubuntu-CU-8669dbqfg
chore: install Python with Posit's pre-compiled binaries (for Ubuntu)
2 parents 2b14223 + 39abd2c commit 5c774a3

File tree

1 file changed

+14
-74
lines changed

1 file changed

+14
-74
lines changed

tasks/debian/main.yml

Lines changed: 14 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
2-
3-
- name: Install additional python versions | install system dependencies
2+
- name: Install additional python versions | Install system dependencies
43
ansible.builtin.apt:
54
pkg: "{{ python_system_dependecies }}"
65
state: "{{ apt_install_state | default('latest') }}"
@@ -9,87 +8,28 @@
98
tags:
109
- python-install-system-dependecies
1110

12-
- name: Install additional python versions | download python
13-
ansible.builtin.get_url:
14-
url: "https://www.python.org/ftp/python/{{ item }}/Python-{{ item }}.tgz"
15-
dest: "/tmp/Python-{{ item }}.tgz"
16-
mode: "0644"
17-
loop: "{{ python_versions }}"
18-
tags:
19-
- python-install-download-archives
20-
- python-install-setup-versions
21-
22-
- name: Install additional python versions | extract python
23-
ansible.builtin.unarchive:
24-
remote_src: true
25-
src: "/tmp/Python-{{ item }}.tgz"
26-
dest: "/tmp"
27-
loop: "{{ python_versions }}"
28-
tags:
29-
- python-install-extract-archives
30-
- python-install-setup-versions
31-
32-
- name: Install additional python versions | configure python
33-
ansible.builtin.command: >
34-
./configure \
35-
--prefix=/opt/python/{{ item }}
36-
--enable-shared
37-
--enable-ipv6
38-
LDFLAGS=-Wl,-rpath=/opt/python/{{ item }}/lib,--disable-new-dtags
39-
args:
40-
chdir: /tmp/Python-{{ item }}
41-
creates: /tmp/Python-{{ item }}/Makefile
42-
loop: "{{ python_versions }}"
43-
tags:
44-
- python-install-configure-python
45-
- python-install-setup-versions
46-
47-
- name: Install additional python versions | make python
48-
ansible.builtin.command: >
49-
make
50-
args:
51-
chdir: /tmp/Python-{{ item }}
52-
creates: /tmp/Python-{{ item }}/python-config
53-
loop: "{{ python_versions }}"
11+
- name: Install additional python versions | Set release version
12+
ansible.builtin.set_fact:
13+
ubuntu_release: "{{ ansible_facts['distribution_version'] | replace('.', '') }}"
14+
when: ansible_facts['distribution'] == "Ubuntu"
5415
tags:
55-
- python-install-make
16+
- python-install-set-facts
5617
- python-install-setup-versions
5718

58-
- name: Install additional python versions | install python
59-
ansible.builtin.command: >
60-
make install
61-
args:
62-
chdir: /tmp/Python-{{ item }}
63-
creates: /opt/python/{{ item }}/bin/python3
64-
loop: "{{ python_versions }}"
65-
tags:
66-
- python-install-make-install
67-
- python-install-setup-versions
68-
69-
- name: Install additional python versions | download pip script
19+
- name: Install additional python versions | Download deb package
7020
ansible.builtin.get_url:
71-
url: "https://bootstrap.pypa.io/get-pip.py"
72-
dest: "/tmp/get-pip.py"
21+
url: "https://cdn.rstudio.com/python/ubuntu-{{ ubuntu_release }}/pkgs/python-{{ item }}_1_amd64.deb"
22+
dest: "/tmp/Python-{{ item }}.deb"
7323
mode: "0644"
74-
tags:
75-
- python-install-download-pip-script
76-
- python-install-setup-versions
77-
78-
- name: Install additional python versions | install pip
79-
ansible.builtin.command: >
80-
/opt/python/{{ item }}/bin/python3 /tmp/get-pip.py
81-
changed_when: false
8224
loop: "{{ python_versions }}"
8325
tags:
84-
- python-install-install-pip
26+
- python-install-download-archives
8527
- python-install-setup-versions
8628

87-
- name: Install additional python versions | install virtualenv
88-
ansible.builtin.command: >
89-
/opt/python/{{ item }}/bin/pip install virtualenv
90-
args:
91-
creates: /opt/python/{{ item }}/bin/virtualenv
29+
- name: Install additional python versions | Install deb package
30+
ansible.builtin.apt:
31+
deb: "/tmp/Python-{{ item }}.deb"
9232
loop: "{{ python_versions }}"
9333
tags:
94-
- python-install-install-virtualenv
34+
- python-install-install-archives
9535
- python-install-setup-versions

0 commit comments

Comments
 (0)