blob: 6374aad320b120d80fcaf32887550020c848872d [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
Tatyana Leontovich47dbd3a2017-06-22 17:36:53 +03002{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
Tatyana Leontovichac38bac2017-07-17 14:05:33 +03005{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
Sergii Golovatiuk50f91892017-08-04 18:11:06 +02006{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
7{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +03008
9# Install OpenStack control services
10
ibumarskove23c10e2018-08-20 15:47:58 +040011- description: Install glance on primary controller
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030012 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskove23c10e2018-08-20 15:47:58 +040013 -C 'I@glance:server:role:primary' state.sls glance -b 1
14 node_name: {{ HOSTNAME_CFG01 }}
15 retry: {count: 1, delay: 5}
16 skip_fail: false
17
18- description: Install glance on other controllers
19 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
20 -C 'I@glance:server:role:secondary' state.sls glance -b 1
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030021 node_name: {{ HOSTNAME_CFG01 }}
22 retry: {count: 1, delay: 5}
23 skip_fail: false
24
25- description: Install keystone service (note that different fernet keys are created on different nodes)
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030026 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
27 -C 'I@keystone:server' state.sls keystone.server -b 1
28 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovichd4f1fd32017-04-21 13:31:44 +030029 retry: {count: 2, delay: 15}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030030 skip_fail: false
31
Tatyana Leontovichfa7ae4d2017-04-25 13:46:14 +030032- description: Restart apache due to PROD-10477
33 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 15}
36 skip_fail: false
37
38- description: Check apache status to PROD-10477
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
40 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 1, delay: 15}
42 skip_fail: false
43
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030044- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
45 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
46 -C 'I@glance:server' state.sls glusterfs.client
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: false
50
51- description: Update fernet keys for keystone server on the mounted glusterfs volume
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
53 -C 'I@keystone:server' state.sls keystone.server -b 1
54 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030058- description: Populate keystone services/tenants/admins
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
60 -C 'I@keystone:client' state.sls keystone.client
61 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020062 retry: {count: 2, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030063 skip_fail: false
64
65- description: Check keystone service-list
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb1488692017-11-22 18:39:51 +020067 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030068 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: false
71
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030072- description: Check glance image-list
73 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
74 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 1, delay: 5}
77 skip_fail: false
78
79
80- description: Install nova on all controllers
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@nova:controller' state.sls nova -b 1
83 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030084 retry: {count: 2, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030085 skip_fail: false
86
87- description: Check nova service-list
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich902f1b42017-07-27 17:00:19 +030089 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030090 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovich902f1b42017-07-27 17:00:19 +030091 retry: {count: 3, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030092 skip_fail: false
93
94
95- description: Install cinder
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
97 -C 'I@cinder:controller' state.sls cinder -b 1
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 1, delay: 5}
100 skip_fail: false
101
102- description: Check cinder list
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
104 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 1, delay: 5}
107 skip_fail: false
108
109
110- description: Install neutron service
111 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
112 -C 'I@neutron:server' state.sls neutron -b 1
113 node_name: {{ HOSTNAME_CFG01 }}
114 retry: {count: 1, delay: 5}
115 skip_fail: false
116
117- description: Install neutron on gtw node
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
119 -C 'I@neutron:gateway' state.sls neutron
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: false
123
ibumarskovc075df82018-07-30 13:23:07 +0400124# install designate
Tatyana Leontovich85e822a2017-06-15 11:52:01 +0300125- description: Install bind
126 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich033aac02017-06-15 15:01:21 +0300127 -C 'I@bind:server' state.sls bind
Tatyana Leontovich85e822a2017-06-15 11:52:01 +0300128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 5}
130 skip_fail: false
131
132- description: Install designate
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich033aac02017-06-15 15:01:21 +0300134 -C 'I@designate:server' state.sls designate -b 1
Tatyana Leontovich85e822a2017-06-15 11:52:01 +0300135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 5, delay: 10}
137 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300138
139- description: Check neutron agent-list
140 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
141 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
142 node_name: {{ HOSTNAME_CFG01 }}
143 retry: {count: 1, delay: 5}
144 skip_fail: false
145
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300146- description: Install heat service
147 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
148 -C 'I@heat:server' state.sls heat -b 1
149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 1, delay: 5}
151 skip_fail: false
152
153- description: Check heat service
154 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb1488692017-11-22 18:39:51 +0200155 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300156 node_name: {{ HOSTNAME_CFG01 }}
Igor Yozhikov8ec6d2f2017-05-23 16:17:29 +0300157 retry: {count: 5, delay: 10}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300158 skip_fail: false
159
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300160- description: Deploy horizon dashboard
161 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
162 -C 'I@horizon:server' state.sls horizon
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 1, delay: 5}
165 skip_fail: true
166
167- description: Deploy nginx proxy
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
169 -C 'I@nginx:server' state.sls nginx
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 1, delay: 5}
172 skip_fail: true
173
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300174# Install compute node
175
176- description: Apply formulas for compute node
177 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
178 node_name: {{ HOSTNAME_CFG01 }}
179 retry: {count: 1, delay: 5}
180 skip_fail: true
181
182- description: Re-apply(as in doc) formulas for compute node
183 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
184 node_name: {{ HOSTNAME_CFG01 }}
185 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200186 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300187
188- description: Check IP on computes
189 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
190 'ip a'
191 node_name: {{ HOSTNAME_CFG01 }}
192 retry: {count: 10, delay: 30}
193 skip_fail: false
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300194
195
196 # Upload cirros image
197
198- description: Upload cirros image on ctl01
199 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400200 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300201 node_name: {{ HOSTNAME_CFG01 }}
202 retry: {count: 2, delay: 30}
203 skip_fail: false
204
205- description: Register image in glance
206 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400207 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300208 node_name: {{ HOSTNAME_CFG01 }}
209 retry: {count: 1, delay: 30}
210 skip_fail: false
211
212- description: Create net04_external
213 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Tatyana Leontovich674abf82017-07-20 15:44:15 +0300214 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300215 node_name: {{ HOSTNAME_CFG01 }}
216 retry: {count: 1, delay: 30}
217 skip_fail: false
218
219- description: Create subnet_external
220 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
221 '. /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'
222 node_name: {{ HOSTNAME_CFG01 }}
223 retry: {count: 1, delay: 30}
224 skip_fail: false
225
226- description: Create net04
227 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
228 '. /root/keystonercv3; neutron net-create net04'
229 node_name: {{ HOSTNAME_CFG01 }}
230 retry: {count: 1, delay: 30}
231 skip_fail: false
232
233- description: Create subnet_net04
234 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
235 '. /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'
236 node_name: {{ HOSTNAME_CFG01 }}
237 retry: {count: 1, delay: 30}
238 skip_fail: false
239
240- description: Create router
241 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
242 '. /root/keystonercv3; neutron router-create net04_router01'
243 node_name: {{ HOSTNAME_CFG01 }}
244 retry: {count: 1, delay: 30}
245 skip_fail: false
246
ibumarskovc075df82018-07-30 13:23:07 +0400247- description: Set gateway
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300248 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
249 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
250 node_name: {{ HOSTNAME_CFG01 }}
251 retry: {count: 1, delay: 30}
252 skip_fail: false
253
254- description: Add interface
255 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
256 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
257 node_name: {{ HOSTNAME_CFG01 }}
258 retry: {count: 1, delay: 30}
259 skip_fail: false
260
261- description: Allow all tcp
262 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
263 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
264 node_name: {{ HOSTNAME_CFG01 }}
265 retry: {count: 1, delay: 30}
266 skip_fail: false
267
268- description: Allow all icmp
269 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
270 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
271 node_name: {{ HOSTNAME_CFG01 }}
272 retry: {count: 1, delay: 30}
273 skip_fail: false
274
Tatyana Leontovich07bc6ed2017-07-25 13:26:48 +0300275- description: sync time
276 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
277 'service ntp stop; ntpd -gq; service ntp start'
278 node_name: {{ HOSTNAME_CFG01 }}
279 retry: {count: 1, delay: 30}
280 skip_fail: false
281
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300282# Configure cinder-volume salt-call
283- description: Set disks 01
284 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
Tatyana Leontovich135d8152017-06-27 16:10:42 +0300285 node_name: {{ HOSTNAME_CTL01 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300286 retry: {count: 1, delay: 30}
287 skip_fail: false
288
289- description: Set disks 02
290 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
291 node_name: {{ HOSTNAME_CTL02 }}
292 retry: {count: 1, delay: 30}
293 skip_fail: false
294
295- description: Set disks 03
296 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
297 node_name: {{ HOSTNAME_CTL03 }}
298 retry: {count: 1, delay: 30}
299 skip_fail: false
300
301- description: Create partitions 01
302 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
303 node_name: {{ HOSTNAME_CTL01 }}
304 retry: {count: 1, delay: 30}
305 skip_fail: false
306
307- description: Create partitions 02
308 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300309 node_name: {{ HOSTNAME_CTL02 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300310 retry: {count: 1, delay: 30}
311 skip_fail: false
312
313- description: Create partitions 03
314 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300315 node_name: {{ HOSTNAME_CTL03 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300316 retry: {count: 1, delay: 30}
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300317 skip_fail: false
318
319- description: create volume_group
320 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
321 node_name: {{ HOSTNAME_CFG01 }}
322 retry: {count: 1, delay: 30}
323 skip_fail: false
324
325- description: Install cinder-volume
326 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
327 node_name: {{ HOSTNAME_CFG01 }}
328 retry: {count: 1, delay: 30}
329 skip_fail: false
330
331- description: Install crudini
332 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
333 node_name: {{ HOSTNAME_CFG01 }}
334 retry: {count: 1, delay: 30}
335 skip_fail: false
336
337- description: Temporary WR set enabled backends value 01
338 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
339 node_name: {{ HOSTNAME_CTL01 }}
340 retry: {count: 1, delay: 30}
341 skip_fail: false
342
343- description: Temporary WR set enabled backends value 02
344 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
345 node_name: {{ HOSTNAME_CTL02 }}
346 retry: {count: 1, delay: 30}
347 skip_fail: false
348
349- description: Temporary WR set enabled backends value 03
350 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
351 node_name: {{ HOSTNAME_CTL03 }}
352 retry: {count: 1, delay: 30}
353 skip_fail: false
354
Tatyana Leontovich47f7bfe2018-01-05 13:36:09 +0200355- description: Restart cinder volume
356 cmd: |
357 salt -C 'I@cinder:controller' service.restart cinder-volume;
358 node_name: {{ HOSTNAME_CFG01 }}
359 retry: {count: 2, delay: 5}
360 skip_fail: false
361
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300362- description: Install docker.io on gtw
363 cmd: salt-call cmd.run 'apt-get install docker.io -y'
364 node_name: {{ HOSTNAME_GTW01 }}
365 retry: {count: 1, delay: 30}
366 skip_fail: false
367
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200368- description: Enable forward policy
369 cmd: iptables --policy FORWARD ACCEPT
370 node_name: {{ HOSTNAME_GTW01 }}
371 retry: {count: 1, delay: 30}
372 skip_fail: false
373
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300374- description: create rc file on cfg
375 cmd: scp ctl01:/root/keystonercv3 /root
376 node_name: {{ HOSTNAME_CFG01 }}
377 retry: {count: 1, delay: 30}
378 skip_fail: false
379
380- description: Copy rc file
381 cmd: scp /root/keystonercv3 gtw01:/root
382 node_name: {{ HOSTNAME_CFG01 }}
383 retry: {count: 1, delay: 30}
384 skip_fail: false