2015-12-30 21:15:18 +00:00
|
|
|
---
|
2016-02-19 17:48:53 +00:00
|
|
|
- name: Bootstrap | Check if bootstrap is needed
|
|
|
|
raw: stat /opt/bin/.bootstrapped
|
2015-12-30 21:15:18 +00:00
|
|
|
register: need_bootstrap
|
2016-12-27 11:38:54 +00:00
|
|
|
failed_when: false
|
2017-11-06 13:51:07 +00:00
|
|
|
changed_when: false
|
2017-10-05 07:43:04 +00:00
|
|
|
tags:
|
|
|
|
- facts
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2016-02-19 17:48:53 +00:00
|
|
|
- name: Bootstrap | Run bootstrap.sh
|
2015-12-30 21:15:18 +00:00
|
|
|
script: bootstrap.sh
|
2017-09-20 13:30:09 +00:00
|
|
|
when: need_bootstrap.rc != 0
|
2015-12-30 21:15:18 +00:00
|
|
|
|
|
|
|
- set_fact:
|
2016-02-19 17:48:53 +00:00
|
|
|
ansible_python_interpreter: "/opt/bin/python"
|
2017-10-05 07:43:04 +00:00
|
|
|
tags:
|
|
|
|
- facts
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2016-02-19 17:48:53 +00:00
|
|
|
- name: Bootstrap | Check if we need to install pip
|
2015-12-30 21:15:18 +00:00
|
|
|
shell: "{{ansible_python_interpreter}} -m pip --version"
|
|
|
|
register: need_pip
|
2016-12-27 11:38:54 +00:00
|
|
|
failed_when: false
|
2015-12-30 21:15:18 +00:00
|
|
|
changed_when: false
|
2017-02-06 18:13:21 +00:00
|
|
|
check_mode: no
|
2017-09-20 13:30:09 +00:00
|
|
|
when: need_bootstrap.rc != 0
|
2017-10-05 07:43:04 +00:00
|
|
|
tags:
|
|
|
|
- facts
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2016-02-19 17:48:53 +00:00
|
|
|
- name: Bootstrap | Copy get-pip.py
|
2017-02-17 21:22:34 +00:00
|
|
|
copy:
|
|
|
|
src: get-pip.py
|
|
|
|
dest: ~/get-pip.py
|
2017-09-20 13:30:09 +00:00
|
|
|
when: need_pip != 0
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2016-02-19 17:48:53 +00:00
|
|
|
- name: Bootstrap | Install pip
|
2015-12-30 21:15:18 +00:00
|
|
|
shell: "{{ansible_python_interpreter}} ~/get-pip.py"
|
2017-09-20 13:30:09 +00:00
|
|
|
when: need_pip != 0
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2016-02-19 17:48:53 +00:00
|
|
|
- name: Bootstrap | Remove get-pip.py
|
2017-02-17 21:22:34 +00:00
|
|
|
file:
|
|
|
|
path: ~/get-pip.py
|
|
|
|
state: absent
|
2017-09-20 13:30:09 +00:00
|
|
|
when: need_pip != 0
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2016-02-19 17:48:53 +00:00
|
|
|
- name: Bootstrap | Install pip launcher
|
2017-02-17 21:22:34 +00:00
|
|
|
copy:
|
|
|
|
src: runner
|
|
|
|
dest: /opt/bin/pip
|
|
|
|
mode: 0755
|
2017-09-20 13:30:09 +00:00
|
|
|
when: need_pip != 0
|
2015-12-30 21:15:18 +00:00
|
|
|
|
|
|
|
- name: Install required python modules
|
|
|
|
pip:
|
|
|
|
name: "{{ item }}"
|
2017-11-03 07:11:36 +00:00
|
|
|
with_items: "{{pip_python_coreos_modules}}"
|