Last active
August 29, 2015 14:21
-
-
Save andypost/e5b4f7053a6a0451538f to your computer and use it in GitHub Desktop.
Ansible playbook to bootstrap python for coreOS
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: 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