Skip to content

Instantly share code, notes, and snippets.

@yubessy
Last active Sep 12, 2017
Embed
What would you like to do?
Ansible Python Role
---
python_version: 3.6.2
---
- 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