-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathtasks_python3.yml
More file actions
94 lines (87 loc) · 2.17 KB
/
Copy pathtasks_python3.yml
File metadata and controls
94 lines (87 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
- name: Python3 | Check is installed
command: "python3 --version"
register: py3_installed
ignore_errors: true
failed_when: "'Python {{ python_version }}' not in py3_installed.stdout"
changed_when: False
tags:
- python3
- name: Python3 | install dependencies
apt:
pkg:
- make
- build-essential
- libffi-dev
- zlib1g-dev
- libreadline-gplv2-dev
- libncursesw5-dev
- libssl-dev
- libsqlite3-dev
- tk-dev
- libgdbm-dev
- libc6-dev
- libbz2-dev
state: present
retries: 3
register: result
until: result is not failed
when: py3_installed is failed and ansible_distribution in ["Ubuntu"]
become: yes
tags:
- python3
- name: Python3 | install dependencies
apt:
pkg:
- "gcc"
- "glibc"
- "glibc-common"
- "gd"
- "gd-devel"
- "zlib-devel"
state: present
retries: 3
register: result
until: result is not failed
become: yes
when: py3_installed is failed and ansible_distribution in ["Redhat", "CentOS"]
tags:
- python3
- name: Python3 | Download distribution
get_url:
url: "https://www.python.org/ftp/python/{{ python_version }}/Python-{{ python_version }}.tgz"
dest: /tmp/Python-{{ python_version }}.tgz
when: py3_installed is failed
tags:
- python3
- name: Python3 | Unpack distribution
unarchive:
src: /tmp/Python-{{ python_version }}.tgz
dest: /tmp
remote_src: yes
when: py3_installed is failed
tags:
- python3
- name: Python3 | Configure for install
command: "./configure"
args:
chdir: "/tmp/Python-{{ python_version }}"
when: py3_installed is failed
tags:
- python3
- name: Python3 | make
command: "make"
args:
chdir: "/tmp/Python-{{ python_version }}"
when: py3_installed is failed
become: yes
tags:
- python3
- name: Python3 | make install
command: "make install"
args:
chdir: "/tmp/Python-{{ python_version }}"
when: py3_installed is failed
become: yes
tags:
- python3