-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook_run_loader.yml
47 lines (38 loc) · 1.23 KB
/
playbook_run_loader.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
- import_playbook: playbook_pre_tasks.yml
- import_playbook: playbook_launch_instance.yml
- name: Configure Servers
hosts: launched
user: core
gather_facts: False
roles:
- akirak.coreos-python
vars_files:
- "environments/{{ env }}/main.yml" # ENV must always be loaded first
- "environments/shared_secrets.yml"
- "environments/shared_variables.yml"
vars:
API_ACCESS_TOKEN: "{{ LOADER_BUILD_API_ACCESS_TOKEN if env == 'build' else LOADER_STAGE_API_ACCESS_TOKEN }}"
tasks:
- name: Setup Docker, Setup Neo, Run Loader, Push Images
block:
- include_tasks: tasks/install_docker_py.yml
- include_tasks: tasks/setup_docker.yml
- include_tasks: tasks/start_neo_env.yml
- include_tasks: tasks/run_loader.yml
- include_tasks: tasks/push_neo_image.yml
- set_fact:
failed_flag: "passed"
rescue:
- debug:
msg: "Error Detected Failing Build"
- set_fact:
failed_flag: "failed"
- import_playbook: playbook_terminate_instance.yml
- name: Check Failures
hosts: launched
gather_facts: False
tasks:
- fail:
msg: "The execution has failed because of errors."
when: failed_flag == "failed"