-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrestart_elk.yml
45 lines (39 loc) · 1.06 KB
/
restart_elk.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
---
- import_playbook: playbook_launch_pre_tasks.yml
- name: Restart ELK Stack
hosts: remote
user: core
gather_facts: False
vars_files:
- "environments/{{ env }}/main.yml" # ENV must always be loaded first
- "environments/shared_secrets.yml"
- "environments/shared_variables.yml"
tasks:
- name: Login to Docker
block:
- include_tasks: tasks/docker_login.yml
- set_fact:
failed_flag: "passed"
rescue:
- debug:
msg: "Failed execute docker login."
- set_fact:
failed_flag: "failed"
- name: Restart ELK Stack
block:
- include_tasks: tasks/stop_elk.yml
- 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: remote
gather_facts: False
tasks:
- fail:
msg: "The execution has failed because of errors."
when: failed_flag == "failed"