forked from dhellmann/ansible-python-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.yml
More file actions
91 lines (84 loc) · 1.88 KB
/
main.yml
File metadata and controls
91 lines (84 loc) · 1.88 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
---
- name: Install tools for adding PPA repositories
become: true
apt:
name: software-properties-common
state: latest
- name: Install Python dependencies
become: true
apt:
name:
- libffi-dev
- gcc
- openssl
- libssl-dev
state: latest
update_cache: true
- include: deadsnakes.yml
- include: pypy.yml
- name: Install python
become: true
apt:
name:
- "python{{ item.version }}"
- "python{{ item.version }}-dev"
- "python{{ item.version }}-venv"
state: latest
with_items: "{{ python_dev_versions }}"
- name: Install extra python support libs
become: true
apt:
name: python-gdbm
state: latest
- name: Remove system package for pip
apt:
name: python-pip
state: absent
become: true
- name: Download get-pip.py
get_url:
url: https://bootstrap.pypa.io/get-pip.py
dest: /tmp/get-pip.py
mode: 0755
- name: Install pip from source
become: true
command: "python{{ item.version }} /tmp/get-pip.py"
args:
creates: "/usr/local/bin/pip{{ item.version }}"
with_items: "{{ python_dev_versions }}"
- name: Create ~/.pip
file:
path: "{{ ansible_env.HOME }}/.pip"
state: directory
- name: Create pip wheelhouse
file:
path: "{{ python_dev_wheelhouse }}"
state: directory
- name: ~/.pip.conf
template:
src: pip.conf
dest: "{{ ansible_env.HOME }}/.pip/pip.conf"
- name: Install pip tools
pip:
name: "{{ item[1] }}"
executable: "pip{{ item[0].version }}"
become: true
with_nested:
- "{{ python_dev_versions }}"
- [ 'wheel', 'certifi', 'pyopenssl', 'pyasn1', 'ndg-httpsclient' ]
- name: Remove system package for virtualenv
apt:
name: python3-venv
state: absent
become: true
- name: Install Python tools
become: true
pip:
name: "{{ item }}"
with_items:
- pbr
- tox
- virtualenv
- virtualenvwrapper
- wheel
- flake8