blob: 7b8ac45abcc1bbe392c7bba1da111c7f5aaa8edf [file] [log] [blame]
Oleksii Butenko8be76f62018-03-30 13:35:26 +03001{% from 'virtual-mcp-pike-dvr-ssl-barbican/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-pike-dvr-ssl-barbican/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-pike-dvr-ssl-barbican/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-pike-dvr-ssl-barbican/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-mcp-pike-dvr-ssl-barbican/underlay.yaml' import HOSTNAME_GTW01 with context %}
6{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
7{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
8{% set LAB_CONFIG_NAME = os_env('LAB_CONFIG_NAME') %}
9# Install OpenStack control services
10
11- description: Nginx
12 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
13 -C 'I@nginx:server' state.sls salt.minion
14 node_name: {{ HOSTNAME_CFG01 }}
15 retry: {count: 1, delay: 5}
16 skip_fail: true
17
18- description: Deploy nginx proxy
19 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
20 -C 'I@nginx:server' state.sls nginx
21 node_name: {{ HOSTNAME_CFG01 }}
22 retry: {count: 1, delay: 5}
23 skip_fail: true
24
25- description: Install glance on all controllers
26 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
27 -C 'I@glance:server' state.sls glance -b 1
28 node_name: {{ HOSTNAME_CFG01 }}
29 retry: {count: 1, delay: 5}
30 skip_fail: false
31
32- description: Install keystone service (note that different fernet keys are created on different nodes)
33 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
34 -C 'I@keystone:server' state.sls keystone.server -b 1
35 node_name: {{ HOSTNAME_CFG01 }}
36 retry: {count: 2, delay: 15}
37 skip_fail: false
38
39- description: Restart apache due to PROD-10477
40 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 15}
43 skip_fail: false
44
45- description: Check apache status to PROD-10477
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 15}
49 skip_fail: false
50
51- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
53 -C 'I@glance:server' state.sls glusterfs.client
54 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57
58- description: Update fernet keys for keystone server on the mounted glusterfs volume
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
60 -C 'I@keystone:server' state.sls keystone.server -b 1
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 5}
63 skip_fail: false
64
65- description: Populate keystone services/tenants/admins
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
67 -C 'I@keystone:client' state.sls keystone.client
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 2, delay: 5}
70 skip_fail: false
71
72- description: Check keystone service-list
73 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
74 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 1, delay: 5}
77 skip_fail: false
78
79- description: Check glance image-list
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 1, delay: 5}
84 skip_fail: false
85
86
87- description: Install nova on all controllers
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@nova:controller' state.sls nova -b 1
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 2, delay: 5}
92 skip_fail: false
93
94- description: Check nova service-list
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 3, delay: 5}
99 skip_fail: false
100
101
102- description: Install cinder
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
104 -C 'I@cinder:controller' state.sls cinder -b 1
105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 1, delay: 5}
107 skip_fail: false
108
109- description: Check cinder list
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: false
115
116
117- description: Install neutron service
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
119 -C 'I@neutron:server' state.sls neutron -b 1
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: false
123
124- description: Install neutron on gtw node
125 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
126 -C 'I@neutron:gateway' state.sls neutron
127 node_name: {{ HOSTNAME_CFG01 }}
128 retry: {count: 1, delay: 5}
129 skip_fail: false
130
131# isntall designate
132- description: Install powerdns
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
134 -C 'I@powerdns:server' state.sls powerdns.server
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 5}
137 skip_fail: false
138
139- description: Install designate
140 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
141 -C 'I@designate:server' state.sls designate -b 1
142 node_name: {{ HOSTNAME_CFG01 }}
143 retry: {count: 5, delay: 10}
144 skip_fail: false
145
146- description: Check neutron agent-list
147 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
148 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 1, delay: 5}
151 skip_fail: false
152
153- description: Install heat service
154 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
155 -C 'I@heat:server' state.sls heat -b 1
156 node_name: {{ HOSTNAME_CFG01 }}
157 retry: {count: 1, delay: 5}
158 skip_fail: false
159
160- description: Check heat service
161 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
162 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 5, delay: 10}
165 skip_fail: false
166
167
168- description: Deploy horizon dashboard
169 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
170 -C 'I@horizon:server' state.sls horizon
171 node_name: {{ HOSTNAME_CFG01 }}
172 retry: {count: 1, delay: 5}
173 skip_fail: false
174
175# Install DogTag server service
176- description: Install DogTag server service
177 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
178 -C 'I@dogtag:server and *01*' state.sls dogtag.server
179 node_name: {{ HOSTNAME_CFG01 }}
180 retry: {count: 1, delay: 5}
181 skip_fail: false
182
183- description: Install DogTag server service
184 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
185 -C 'I@dogtag:server' state.sls dogtag.server
186 node_name: {{ HOSTNAME_CFG01 }}
187 retry: {count: 1, delay: 5}
188 skip_fail: false
189
190# Install Barbican server service
191- description: Install Barbican server service
192 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
193 -C 'I@barbican:server and *01*' state.sls barbican.server
194 node_name: {{ HOSTNAME_CFG01 }}
195 retry: {count: 1, delay: 5}
196 skip_fail: false
197
198- description: Install Barbican server service
199 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
200 -C 'I@barbican:server' state.sls barbican.server
201 node_name: {{ HOSTNAME_CFG01 }}
202 retry: {count: 1, delay: 5}
203 skip_fail: false
204
205- description: Install Barbican client
206 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
207 -C 'I@barbican:client' state.sls barbican.client
208 node_name: {{ HOSTNAME_CFG01 }}
209 retry: {count: 1, delay: 5}
210 skip_fail: True
211
212# Install compute node
213
214- description: Apply formulas for compute node
215 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
216 node_name: {{ HOSTNAME_CFG01 }}
217 retry: {count: 1, delay: 5}
218 skip_fail: true
219
220- description: Re-apply(as in doc) formulas for compute node
221 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
222 node_name: {{ HOSTNAME_CFG01 }}
223 retry: {count: 1, delay: 5}
224 skip_fail: false
225
226- description: Check IP on computes
227 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
228 'ip a'
229 node_name: {{ HOSTNAME_CFG01 }}
230 retry: {count: 10, delay: 30}
231 skip_fail: false
232
233
234 # Upload cirros image
235
236- description: Upload cirros image on ctl01
237 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
238 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 2, delay: 30}
241 skip_fail: false
242
243- description: Register image in glance
244 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
245 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img'
246 node_name: {{ HOSTNAME_CFG01 }}
247 retry: {count: 1, delay: 30}
248 skip_fail: false
249
250- description: Create net04_external
251 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
252 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
253 node_name: {{ HOSTNAME_CFG01 }}
254 retry: {count: 1, delay: 30}
255 skip_fail: false
256
257- description: Create subnet_external
258 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
259 '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1'
260 node_name: {{ HOSTNAME_CFG01 }}
261 retry: {count: 1, delay: 30}
262 skip_fail: false
263
264- description: Create net04
265 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
266 '. /root/keystonercv3; neutron net-create net04'
267 node_name: {{ HOSTNAME_CFG01 }}
268 retry: {count: 1, delay: 30}
269 skip_fail: false
270
271- description: Create subnet_net04
272 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
273 '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240'
274 node_name: {{ HOSTNAME_CFG01 }}
275 retry: {count: 1, delay: 30}
276 skip_fail: false
277
278- description: Create router
279 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
280 '. /root/keystonercv3; neutron router-create net04_router01'
281 node_name: {{ HOSTNAME_CFG01 }}
282 retry: {count: 1, delay: 30}
283 skip_fail: false
284
285- description: Set geteway
286 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
287 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
288 node_name: {{ HOSTNAME_CFG01 }}
289 retry: {count: 1, delay: 30}
290 skip_fail: false
291
292- description: Add interface
293 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
294 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
295 node_name: {{ HOSTNAME_CFG01 }}
296 retry: {count: 1, delay: 30}
297 skip_fail: false
298
299#- description: Allow all tcp
300# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
301# '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
302# node_name: {{ HOSTNAME_CFG01 }}
303# retry: {count: 1, delay: 30}
304# skip_fail: false
305#
306#- description: Allow all icmp
307# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
308# '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
309# node_name: {{ HOSTNAME_CFG01 }}
310# retry: {count: 1, delay: 30}
311# skip_fail: false
312
313- description: sync time
314 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
315 'service ntp stop; ntpd -gq; service ntp start'
316 node_name: {{ HOSTNAME_CFG01 }}
317 retry: {count: 1, delay: 30}
318 skip_fail: false
319
320# Configure cinder-volume salt-call PROD-13167
321- description: Set disks 01
322 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
323 node_name: {{ HOSTNAME_CTL01 }}
324 retry: {count: 1, delay: 30}
325 skip_fail: false
326
327- description: Set disks 02
328 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
329 node_name: {{ HOSTNAME_CTL02 }}
330 retry: {count: 1, delay: 30}
331 skip_fail: false
332
333- description: Set disks 03
334 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
335 node_name: {{ HOSTNAME_CTL03 }}
336 retry: {count: 1, delay: 30}
337 skip_fail: false
338
339- description: Create partitions 01
340 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
341 node_name: {{ HOSTNAME_CTL01 }}
342 retry: {count: 1, delay: 30}
343 skip_fail: false
344
345- description: Create partitions 02
346 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
347 node_name: {{ HOSTNAME_CTL02 }}
348 retry: {count: 1, delay: 30}
349 skip_fail: false
350
351- description: Create partitions 03
352 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
353 node_name: {{ HOSTNAME_CTL03 }}
354 retry: {count: 1, delay: 30}
355 skip_fail: false
356
357- description: create volume_group
358 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
359 node_name: {{ HOSTNAME_CFG01 }}
360 retry: {count: 1, delay: 30}
361 skip_fail: false
362
363- description: Install cinder-volume
364 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
365 node_name: {{ HOSTNAME_CFG01 }}
366 retry: {count: 1, delay: 30}
367 skip_fail: false
368
369- description: Install crudini
370 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
371 node_name: {{ HOSTNAME_CFG01 }}
372 retry: {count: 1, delay: 30}
373 skip_fail: false
374
375- description: Temporary WR set enabled backends value 01
376 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
377 node_name: {{ HOSTNAME_CTL01 }}
378 retry: {count: 1, delay: 30}
379 skip_fail: false
380
381- description: Temporary WR set enabled backends value 02
382 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
383 node_name: {{ HOSTNAME_CTL02 }}
384 retry: {count: 1, delay: 30}
385 skip_fail: false
386
387- description: Temporary WR set enabled backends value 03
388 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
389 node_name: {{ HOSTNAME_CTL03 }}
390 retry: {count: 1, delay: 30}
391 skip_fail: false
392
393- description: Install docker.io on gtw
394 cmd: salt-call cmd.run 'apt-get install docker.io -y'
395 node_name: {{ HOSTNAME_GTW01 }}
396 retry: {count: 1, delay: 30}
397 skip_fail: false
398
399- description: Enable forward policy
400 cmd: iptables --policy FORWARD ACCEPT
401 node_name: {{ HOSTNAME_GTW01 }}
402 retry: {count: 1, delay: 30}
403 skip_fail: false
404
405- description: Restart cinder volume
406 cmd: |
407 salt -C 'I@cinder:controller' service.restart cinder-volume;
408 node_name: {{ HOSTNAME_CFG01 }}
409 retry: {count: 2, delay: 5}
410 skip_fail: false
411
412- description: create rc file on cfg
413 cmd: scp ctl01:/root/keystonercv3 /root
414 node_name: {{ HOSTNAME_CFG01 }}
415 retry: {count: 1, delay: 30}
416 skip_fail: false
417
418- description: Copy rc file
419 cmd: scp /root/keystonercv3 gtw01:/root
420 node_name: {{ HOSTNAME_CFG01 }}
421 retry: {count: 1, delay: 30}
422 skip_fail: false