Skip to content

Instantly share code, notes, and snippets.

@altnight
Created May 6, 2014 14:51
Show Gist options
  • Save altnight/eccb3266dfd84e7592b2 to your computer and use it in GitHub Desktop.
Save altnight/eccb3266dfd84e7592b2 to your computer and use it in GitHub Desktop.
ansible playbook for install python 3.4
---
- hosts: 127.0.0.1
connection: local
user: (user)
vars:
tmpdir: "/Users/(user)/tmpfile/python"
name: "Python"
version: "3.4.0"
tasks:
- name: "make dir"
local_action: command mkdir -p {{ tmpdir }}/{{ version }}
- name: "wget src"
local_action: get_url url=http://www.python.org/ftp/python/{{ version }}/Python-{{ version }}.tgz dest={{ tmpdir }}/{{ version }}
- name: "tar"
local_action: command tar xzvf Python-{{ version }}.tgz chdir={{ tmpdir }}/{{ version }}
- name: "configure"
local_action: command {{ tmpdir }}/{{ version }}/{{ name }}-{{ version }}/configure --prefix={{ tmpdir }}/{{ version }} chdir={{ tmpdir }}/{{ version }}
- name: "make"
local_action: command make chdir={{ tmpdir }}/{{ version }}
- name: "make install"
local_action: command make install chdir={{ tmpdir }}/{{ version }}
@altnight
Copy link
Author

altnight commented May 6, 2014

TODO:

  • add 2.7, 3.2, 3.3
  • refactoring
  • make symbolic link
  • zsh, vim, ... etc
    • make install module (or search)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment