-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample_2.yml
112 lines (96 loc) · 2.6 KB
/
sample_2.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
# Initial Step:
#
# Schedule a new job giving a specific topic and specifying the remote CI.
# The return of this action contains all the data associated with the job,
# we hence register those data for later consumptions
#
- hosts: localhost
gather_facts: false
tasks:
- include_tasks: 'new.yml'
- block:
- name: echo 'New'
shell: echo 'New'
rescue:
- name: Fail properly
fail:
msg: 'Something went wrong with the installation'
# Pre-run state
#
# User is free to do whaterver she needs before entering pre-run state.
# Usually this is used to spawn the undercloud vm
#
- hosts: localhost
gather_facts: false
any_errors_fatal: true
vars:
dci_status: 'pre-run'
dci_comment: 'Pre-run state commands'
tasks:
- block:
- name: echo 'Pre-run'
shell: echo 'pre-run'
rescue:
- name: Fail properly
fail:
msg: 'Something went wrong with the installation'
# Running state
#
# User is free to do whaterver she needs before entering running state.
# Usually this is used to provision the undercloud and the overcloud
#
- hosts: localhost
gather_facts: false
any_errors_fatal: true
vars:
dci_status: 'running'
dci_comment: 'Running state commands'
tasks:
- block:
- name: echo 'Running'
shell: echo 'Running'
rescue:
- name: Tear me down
shell: echo 'Tear me down'
- name: Fail properly
fail:
msg: 'Something went wrong with the installation'
# Post-run state
#
# User is free to do whaterver she needs before entering post-run state.
# Usually this is used to run tests on the overcloud
#
- hosts: localhost
gather_facts: false
any_errors_fatal: true
vars:
dci_status: 'post-run'
dci_comment: 'Post-run state commands'
tasks:
- block:
- name: echo 'Post-run'
shell: echo 'Post-run'
rescue:
- name: Tear me down
shell: echo 'Tear me down'
- name: Fail properly
fail:
msg: 'Something went wrong with the installation'
# Success state
#
# User is free to do whaterver she needs before entering pre-run state.
# Usually this is used to teardown the plateform
#
- hosts: localhost
gather_facts: false
any_errors_fatal: true
vars:
dci_status: 'success'
dci_comment: 'Success state commands'
tasks:
- name: echo 'Success'
shell: echo 'Succes'
- name: "Final step"
debug:
msg: "The job is now finished. Review the log at: {{ lookup('env','DCI_UI_URL') | default('https://www.distributed-ci.io', True) }}/jobs/{{ job_info.job.id }}/jobStates"