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