Skip to content

Instantly share code, notes, and snippets.

@andypost
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andypost/e5b4f7053a6a0451538f to your computer and use it in GitHub Desktop.
Save andypost/e5b4f7053a6a0451538f to your computer and use it in GitHub Desktop.
Ansible playbook to bootstrap python for coreOS
- name: bootstrap coreos with real python
hosts: coreos
gather_facts: False
vars:
core_home: /home/core
pypy_file: pypy-2.4.0-linux64.tar.bz2
pypy_dir: pypy-2.4.0-linux64
pypy_shim: |
#!/bin/bash
LD_LIBRARY_PATH={{core_home}}/pypy/lib:$LD_LIBRARY_PATH {{core_home}}/pypy/bin/pypy "$@"
pip_shim: |
#!/bin/bash
LD_LIBRARY_PATH=$HOME/pypy/lib:$LD_LIBRARY_PATH $HOME/pypy/bin/$(basename $0) $@
tasks:
- raw: '[ -e {{ core_home }}/{{ pypy_file }} ]'
ignore_errors: True
register: has_pypy
- raw: wget https://bitbucket.org/pypy/pypy/downloads/{{ pypy_file }}
when: has_pypy|failed
- raw: '[ -d {{ core_home }}/{{ pypy_dir }} ]'
ignore_errors: True
register: has_pypy
- raw: tar -xf {{ pypy_file }}
when: has_pypy|failed
- raw: '[ -d {{ core_home }}/pypy ]'
ignore_errors: True
register: has_pypy
- raw: ln -s {{ pypy_dir }} pypy
when: has_pypy|failed
- raw: '[ -d {{ core_home }}/pypy/lib ]'
ignore_errors: True
register: has_pypy
- raw: mkdir pypy/lib
when: has_pypy|failed
- raw: '[ -e {{core_home}}/pypy/lib/libtinfo.so.5 ]'
ignore_errors: True
register: has_pypylib
- raw: ln -s /lib64/libncurses.so.5.9 "{{core_home}}/pypy/lib/libtinfo.so.5"
when: has_pypylib|failed
- raw: '[ -e {{core_home}}/bin/pypy ]'
ignore_errors: True
register: has_python
- raw: echo '{{pypy_shim}}' > "{{core_home}}/bin/pypy" && chmod 755 "{{core_home}}/bin/pypy"
when: has_python|failed
- raw: bin/pypy --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment