|
1 | 1 | ---
|
2 |
| - |
3 |
| -- name: Install additional python versions | install system dependencies |
| 2 | +- name: Install additional python versions | Install system dependencies |
4 | 3 | ansible.builtin.apt:
|
5 | 4 | pkg: "{{ python_system_dependecies }}"
|
6 | 5 | state: "{{ apt_install_state | default('latest') }}"
|
|
9 | 8 | tags:
|
10 | 9 | - python-install-system-dependecies
|
11 | 10 |
|
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" |
54 | 15 | tags:
|
55 |
| - - python-install-make |
| 16 | + - python-install-set-facts |
56 | 17 | - python-install-setup-versions
|
57 | 18 |
|
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 |
70 | 20 | 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" |
73 | 23 | 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 |
82 | 24 | loop: "{{ python_versions }}"
|
83 | 25 | tags:
|
84 |
| - - python-install-install-pip |
| 26 | + - python-install-download-archives |
85 | 27 | - python-install-setup-versions
|
86 | 28 |
|
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" |
92 | 32 | loop: "{{ python_versions }}"
|
93 | 33 | tags:
|
94 |
| - - python-install-install-virtualenv |
| 34 | + - python-install-install-archives |
95 | 35 | - python-install-setup-versions
|
0 commit comments