-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlaunch_aws.yml
61 lines (54 loc) · 1.47 KB
/
launch_aws.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
- import_playbook: playbook_launch_pre_tasks.yml
- import_playbook: playbook_launch_instance.yml
- name: Configure AWS Instance
hosts: launched
user: core
gather_facts: false
vars:
API_ACCESS_TOKEN: "{{ LOADER_BUILD_API_ACCESS_TOKEN }}"
vars_files:
- "environments/{{ env }}/main.yml" # ENV must always be loaded first
- "environments/shared_secrets.yml"
- "environments/shared_variables.yml"
roles:
- role: install_python
become: true
- role: setup_nvme_drives
when: not SKIP_NVME_DRIVES and not SETUP_NVME_DRIVE
become: true
- role: setup_nvme_drive
when: SETUP_NVME_DRIVE and SKIP_NVME_DRIVES
become: true
- role: setup_docker
become: true
- role: setup_swap
become: true
tasks:
- name: Login to Docker
block:
- include_tasks: tasks/docker_login.yml
- set_fact:
failed_flag: "passed"
rescue:
- debug:
msg: "Error Detected Failing Build"
- set_fact:
failed_flag: "failed"
- name: Start Elk
block:
- include_tasks: tasks/start_elk.yml
- set_fact:
failed_flag: "passed"
rescue:
- debug:
msg: "Error Detected Failing Build"
- set_fact:
failed_flag: "failed"
- name: Check Failures
hosts: launched
gather_facts: False
tasks:
- fail:
msg: "The execution has failed because of errors."
when: failed_flag == "failed"