2015-12-31 05:15:18 +08:00
|
|
|
---
|
2016-02-20 01:48:53 +08:00
|
|
|
- name: Bootstrap | Check if bootstrap is needed
|
|
|
|
raw: stat /opt/bin/.bootstrapped
|
2015-12-31 05:15:18 +08:00
|
|
|
register: need_bootstrap
|
2018-10-20 22:13:54 +08:00
|
|
|
environment: {}
|
2016-12-27 19:38:54 +08:00
|
|
|
failed_when: false
|
2017-11-06 21:51:07 +08:00
|
|
|
changed_when: false
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- facts
|
2015-12-31 05:15:18 +08:00
|
|
|
|
2018-05-09 03:32:52 +08:00
|
|
|
- name: Force binaries directory for Container Linux by CoreOS
|
|
|
|
set_fact:
|
|
|
|
bin_dir: "/opt/bin"
|
|
|
|
tags:
|
|
|
|
- facts
|
|
|
|
|
2016-02-20 01:48:53 +08:00
|
|
|
- name: Bootstrap | Run bootstrap.sh
|
2015-12-31 05:15:18 +08:00
|
|
|
script: bootstrap.sh
|
2017-09-20 21:30:09 +08:00
|
|
|
when: need_bootstrap.rc != 0
|
2015-12-31 05:15:18 +08:00
|
|
|
|
|
|
|
- set_fact:
|
2018-05-09 03:32:52 +08:00
|
|
|
ansible_python_interpreter: "{{ bin_dir }}/python"
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- facts
|
2015-12-31 05:15:18 +08:00
|
|
|
|
2016-02-20 01:48:53 +08:00
|
|
|
- name: Bootstrap | Check if we need to install pip
|
2019-01-02 22:17:20 +08:00
|
|
|
shell: "pip3 --version"
|
2015-12-31 05:15:18 +08:00
|
|
|
register: need_pip
|
2016-12-27 19:38:54 +08:00
|
|
|
failed_when: false
|
2015-12-31 05:15:18 +08:00
|
|
|
changed_when: false
|
2017-02-07 02:13:21 +08:00
|
|
|
check_mode: no
|
2017-10-05 15:43:04 +08:00
|
|
|
tags:
|
|
|
|
- facts
|
2018-05-09 03:32:52 +08:00
|
|
|
environment:
|
|
|
|
PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}"
|
2015-12-31 05:15:18 +08:00
|
|
|
|
2016-02-20 01:48:53 +08:00
|
|
|
- name: Bootstrap | Install pip
|
2019-01-02 22:17:20 +08:00
|
|
|
shell: "{{ ansible_python_interpreter }} -m ensurepip"
|
2018-04-18 16:15:40 +08:00
|
|
|
when: need_pip.rc != 0
|
2015-12-31 05:15:18 +08:00
|
|
|
|
2016-02-20 01:48:53 +08:00
|
|
|
- name: Bootstrap | Install pip launcher
|
2017-02-18 05:22:34 +08:00
|
|
|
copy:
|
|
|
|
src: runner
|
2019-01-02 22:17:20 +08:00
|
|
|
dest: "{{ bin_dir }}/pip3"
|
2017-02-18 05:22:34 +08:00
|
|
|
mode: 0755
|
2018-04-18 16:15:40 +08:00
|
|
|
when: need_pip.rc != 0
|
2015-12-31 05:15:18 +08:00
|
|
|
|
|
|
|
- name: Install required python modules
|
|
|
|
pip:
|
|
|
|
name: "{{ item }}"
|
2018-10-24 13:22:09 +08:00
|
|
|
extra_args: "{{ pip_extra_args | default(omit) }}"
|
2019-01-02 22:17:20 +08:00
|
|
|
with_items: "{{ pip_python_coreos_modules }}"
|
2018-05-09 03:32:52 +08:00
|
|
|
environment:
|
|
|
|
PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}"
|
2018-08-15 02:42:16 +08:00
|
|
|
|
|
|
|
- name: Bootstrap | Disable auto-upgrade
|
|
|
|
shell: "systemctl stop locksmithd.service && systemctl mask --now locksmithd.service"
|
|
|
|
when:
|
|
|
|
- not coreos_auto_upgrade
|