Last active
September 12, 2017 06:25
-
-
Save yubessy/92fb91ca3691905fa3e7aa98b4bf745f to your computer and use it in GitHub Desktop.
Ansible Python Role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
python_version: 3.6.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: python deps are installed | |
yum: | |
name: '{{ item }}' | |
state: present | |
with_items: | |
- zlib-devel | |
- bzip2 | |
- bzip2-devel | |
- readline-devel | |
- sqlite | |
- sqlite-devel | |
- openssl-devel | |
- name: python is downloaded | |
get_url: | |
url: https://www.python.org/ftp/python/{{ python_version }}/Python-{{ python_version }}.tgz | |
dest: /tmp/Python-{{ python_version }}.tgz | |
- name: python is extracted | |
command: tar -xfz /tmp/Python-{{ python_version }}.tgz | |
creates: /tmp/Python-{{ python_version }} | |
set_fact: | |
tmp_python_dir: /tmp/Python-{{ python_version }} | |
- name: build is configured | |
command: ./configure | |
creates: {{ tmp_python_dir }}/Makefile | |
chdir: {{ tmp_python_dir }} | |
- name: python is built | |
command: make | |
creates: {{ tmp_python_dir }}/bin/python | |
chdir: {{ tmp_python_dir }} | |
- name: python is installed | |
command: make install | |
chdir: {{ tmp_python_dir }} | |
creates: /usr/local/bin/python{{ python_version }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment