-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathocp4-workshop.yml
249 lines (164 loc) · 5.08 KB
/
ocp4-workshop.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
##
## This playbook closely mirrors xtoph_deploy.yml
## except it does NOT include any components of
## the xtoph_deploy role. Thus, it provides a manual
## approach to deployment and a means to test individual
## components of the ocp4_workshop role.
##
##
## Bootstrap
##
- hosts: myDeployhost
tasks:
- debug: msg="**** BEGIN DEPLOYER SETUP ****"
- block:
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "setup"
when: ocp4_workshop_cmd == "setup"
- debug: msg="**** END DEPLOYER SETUP ****"
##
## SHUTDOWN
##
- hosts: myWorkers,!myShelter
gather_facts: no
tasks:
- debug: msg="**** BEGIN SHUTDOWN - workers ****"
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "preuninstall-node-shutdown"
when: ocp4_workshop_cmd == "shutdown"
- debug: msg="**** END SHUTDOWN - workers ****"
- hosts: myMasters,mySNO,!myShelter
gather_facts: no
tasks:
- debug: msg="**** BEGIN SHUTDOWN - masters ****"
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "preuninstall-node-shutdown"
when: ocp4_workshop_cmd == "shutdown"
- debug: msg="**** END SHUTDOWN - masters ****"
- hosts: myBootstrap,!myShelter
gather_facts: no
tasks:
- debug: msg="**** BEGIN SHUTDOWN - bootstrap ****"
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "preuninstall-node-shutdown"
when: ocp4_workshop_cmd == "shutdown"
- debug: msg="**** END SHUTDOWN - bootstrap ****"
##
## Bastion host should be deployed,
## proceed with bastion configuration
##
## NOTE: at the completion of this
## step, the workshop playbook 'locks' the
## state of the configs on the bastion
## to prevent successive attempts
## to deploy from creating new certs.
##
## NOTE: we DO need to gather_facts
##
- hosts: myBastion,myBootstrap,myMasters,myWorkers,mySNO
gather_facts: no
tasks:
- debug: msg="**** BEGIN CONFIGURATION - bastion ****"
- debug: var=ocp4_workshop_cmd
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "config-bastion"
xtoph_ocp4_subaction: "{{ ocp4_workshop_subcmd | default('') }}"
when: ocp4_workshop_cmd == "configure"
- debug: msg="**** END CONFIGURATION - bastion ****"
tags: always
##
## Bootstrap
##
- hosts: myBootstrap,myBootstrapFlipFlop
gather_facts: no
tasks:
- debug: msg="**** BEGIN (MANUAL) DEPLOYMENT - Bootstrap ****"
- block:
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "preinstall-node"
xtoph_ocp4_subaction: "preinstall-bootstrap"
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "postinstall-node"
when: ocp4_workshop_cmd == "usher"
- debug: msg="**** END (MANUAL) DEPLOYMENT - Bootstrap ****"
##
## Masters
##
- hosts: myMasters,MySNO,!myBootStrapFlipFlop
gather_facts: no
tasks:
- debug: msg="**** BEGIN (MANUAL) DEPLOYMENT - Masters ****"
- block:
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "preinstall-node"
xtoph_ocp4_subaction: "preinstall-masters"
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "postinstall-node"
when: ocp4_workshop_cmd == "usher"
- debug: msg="**** END (MANUAL) DEPLOYMENT - Masters ****"
- hosts: myBootStrapFlipFlop
gather_facts: no
tasks:
- debug: msg="**** BEGIN (MANUAL) DEPLOYMENT - Masters ****"
- block:
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "preinstall-node"
xtoph_ocp4_subaction: "preinstall-flop"
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "postinstall-node"
when: ocp4_workshop_cmd == "usher"
##
## Workers
##
- hosts: myWorkers
gather_facts: no
tasks:
- debug: msg="**** BEGIN (MANUAL) DEPLOYMENT - Workers ****"
- block:
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "preinstall-node"
xtoph_ocp4_subaction: "preinstall-workers"
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "postinstall-node"
when: ocp4_workshop_cmd == "usher"
- debug: msg="**** END (MANUAL) DEPLOYMENT - Workers ****"
##
## Finish OCP Deployment
##
- hosts: myMasters,myWorkers,mySNO
gather_facts: no
tasks:
- debug: msg="**** BEGIN Cluster Post-Install ****"
- include_role:
name: xtoph_ocp4
vars:
xtoph_ocp4_action: "postinstall-cluster"
when: ocp4_workshop_cmd == "usher" or
ocp4_workshop_cmd == "finish"
- debug: msg="**** END Cluster Post-Install ****"