-
Notifications
You must be signed in to change notification settings - Fork 2
/
raspbian-python3.6.yml
57 lines (57 loc) · 1.67 KB
/
raspbian-python3.6.yml
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
# An ansible role to configure python3.6 on a Raspberry Pi.
# to get started, ensure you have ansible installed:
# $ sudo apt install ansible
# Then run this playbook:
# $ ansible-playbook -i localhost, python3.6.yml
# Then you can get started:
# $ python3.6
#
---
- hosts: all
vars:
version: 3.6.5
threads: 4
tasks:
- name: "python{{version}} runtime&build dependencies"
become: yes
apt: name={{item}}
with_items:
- build-essential
- tk-dev
- libncurses5-dev
- libncursesw5-dev
- libreadline6-dev
- libdb5.3-dev
- libgdbm-dev
- libsqlite3-dev
- libssl-dev
- libbz2-dev
- libexpat1-dev
- liblzma-dev
- zlib1g-dev
- name: "Download python{{version}}"
get_url:
url="https://www.python.org/ftp/python/{{version}}/Python-{{version}}.tar.xz"
dest="/tmp/Python-{{version}}.tar.xz"
- name: "Unarchive python{{version}}"
unarchive:
src="/tmp/Python-{{version}}.tar.xz"
dest="/tmp/"
copy=no
creates="/tmp/Python-{{version}}"
- name: "configure python{{version}} build"
command: ./configure
args:
chdir: "/tmp/Python-{{version}}"
creates: "/tmp/Python-{{version}}/Makefile"
- name: "build python{{version}}"
# not using make module to be able to use -j and creates option to fully skip step
command: make -j{{threads}}
args:
chdir: "/tmp/Python-{{version}}"
creates: "/tmp/Python-{{version}}/python"
- name: "install python{{version}}"
become: yes
make:
chdir: "/tmp/Python-{{version}}"
target: altinstall