First implementation
This commit is contained in:
4
ansible/roles/python/defaults/main.yml
Normal file
4
ansible/roles/python/defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
version: 3.6.6
|
||||
threads: 4
|
52
ansible/roles/python/tasks/main.yml
Normal file
52
ansible/roles/python/tasks/main.yml
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
|
||||
- name: "Install 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
|
||||
- libffi-dev
|
||||
- uuid-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 --prefix=/opt/python-{{version}} --enable-optimizations
|
||||
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
|
Reference in New Issue
Block a user