blob: 5dd422301a99c2791b55cfc0fe445bb657f215b5 [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
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030011- 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)
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030019 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 }}
Tatyana Leontovichd4f1fd32017-04-21 13:31:44 +030022 retry: {count: 2, delay: 15}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030023 skip_fail: false
24
Tatyana Leontovichfa7ae4d2017-04-25 13:46:14 +030025- 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
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030037- 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
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030051- 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 Leontovich38be41b2017-04-12 14:45:23 +030056 skip_fail: false
57
58- description: Check keystone service-list
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb1488692017-11-22 18:39:51 +020060 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030061 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 5}
63 skip_fail: false
64
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030065- description: Check glance image-list
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
67 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
68 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 }}
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030077 retry: {count: 2, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030078 skip_fail: false
79
80- description: Check nova service-list
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich902f1b42017-07-27 17:00:19 +030082 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030083 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovich902f1b42017-07-27 17:00:19 +030084 retry: {count: 3, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030085 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 }}
92 retry: {count: 1, delay: 5}
93 skip_fail: false
94
95- description: Check cinder list
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
97 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
98 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
ibumarskovc075df82018-07-30 13:23:07 +0400117# install designate
Tatyana Leontovich85e822a2017-06-15 11:52:01 +0300118- description: Install bind
119 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich033aac02017-06-15 15:01:21 +0300120 -C 'I@bind:server' state.sls bind
Tatyana Leontovich85e822a2017-06-15 11:52:01 +0300121 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
Tatyana Leontovich033aac02017-06-15 15:01:21 +0300127 -C 'I@designate:server' state.sls designate -b 1
Tatyana Leontovich85e822a2017-06-15 11:52:01 +0300128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 5, delay: 10}
130 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300131
132- description: Check neutron agent-list
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
134 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 5}
137 skip_fail: false
138
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300139- description: Install heat service
140 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
141 -C 'I@heat:server' state.sls heat -b 1
142 node_name: {{ HOSTNAME_CFG01 }}
143 retry: {count: 1, delay: 5}
144 skip_fail: false
145
146- description: Check heat service
147 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb1488692017-11-22 18:39:51 +0200148 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300149 node_name: {{ HOSTNAME_CFG01 }}
Igor Yozhikov8ec6d2f2017-05-23 16:17:29 +0300150 retry: {count: 5, delay: 10}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300151 skip_fail: false
152
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300153- description: Deploy horizon dashboard
154 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
155 -C 'I@horizon:server' state.sls horizon
156 node_name: {{ HOSTNAME_CFG01 }}
157 retry: {count: 1, delay: 5}
158 skip_fail: true
159
160- description: Deploy nginx proxy
161 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
162 -C 'I@nginx:server' state.sls nginx
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 1, delay: 5}
165 skip_fail: true
166
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300167# Install compute node
168
169- description: Apply formulas for compute node
170 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
171 node_name: {{ HOSTNAME_CFG01 }}
172 retry: {count: 1, delay: 5}
173 skip_fail: true
174
175- description: Re-apply(as in doc) formulas for compute node
176 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
177 node_name: {{ HOSTNAME_CFG01 }}
178 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200179 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300180
181- description: Check IP on computes
182 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
183 'ip a'
184 node_name: {{ HOSTNAME_CFG01 }}
185 retry: {count: 10, delay: 30}
186 skip_fail: false
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300187
188
189 # Upload cirros image
190
191- description: Upload cirros image on ctl01
192 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400193 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300194 node_name: {{ HOSTNAME_CFG01 }}
195 retry: {count: 2, delay: 30}
196 skip_fail: false
197
198- description: Register image in glance
199 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400200 '. /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 +0300201 node_name: {{ HOSTNAME_CFG01 }}
202 retry: {count: 1, delay: 30}
203 skip_fail: false
204
205- description: Create net04_external
206 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Tatyana Leontovich674abf82017-07-20 15:44:15 +0300207 '. /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 +0300208 node_name: {{ HOSTNAME_CFG01 }}
209 retry: {count: 1, delay: 30}
210 skip_fail: false
211
212- description: Create subnet_external
213 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
214 '. /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'
215 node_name: {{ HOSTNAME_CFG01 }}
216 retry: {count: 1, delay: 30}
217 skip_fail: false
218
219- description: Create net04
220 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
221 '. /root/keystonercv3; neutron net-create net04'
222 node_name: {{ HOSTNAME_CFG01 }}
223 retry: {count: 1, delay: 30}
224 skip_fail: false
225
226- description: Create subnet_net04
227 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
228 '. /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'
229 node_name: {{ HOSTNAME_CFG01 }}
230 retry: {count: 1, delay: 30}
231 skip_fail: false
232
233- description: Create router
234 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
235 '. /root/keystonercv3; neutron router-create net04_router01'
236 node_name: {{ HOSTNAME_CFG01 }}
237 retry: {count: 1, delay: 30}
238 skip_fail: false
239
ibumarskovc075df82018-07-30 13:23:07 +0400240- description: Set gateway
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300241 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
242 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
243 node_name: {{ HOSTNAME_CFG01 }}
244 retry: {count: 1, delay: 30}
245 skip_fail: false
246
247- description: Add interface
248 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
249 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
250 node_name: {{ HOSTNAME_CFG01 }}
251 retry: {count: 1, delay: 30}
252 skip_fail: false
253
254- description: Allow all tcp
255 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
256 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
257 node_name: {{ HOSTNAME_CFG01 }}
258 retry: {count: 1, delay: 30}
259 skip_fail: false
260
261- description: Allow all icmp
262 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
263 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
264 node_name: {{ HOSTNAME_CFG01 }}
265 retry: {count: 1, delay: 30}
266 skip_fail: false
267
Tatyana Leontovich07bc6ed2017-07-25 13:26:48 +0300268- description: sync time
269 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
270 'service ntp stop; ntpd -gq; service ntp start'
271 node_name: {{ HOSTNAME_CFG01 }}
272 retry: {count: 1, delay: 30}
273 skip_fail: false
274
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300275# Configure cinder-volume salt-call
276- description: Set disks 01
277 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
Tatyana Leontovich135d8152017-06-27 16:10:42 +0300278 node_name: {{ HOSTNAME_CTL01 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300279 retry: {count: 1, delay: 30}
280 skip_fail: false
281
282- description: Set disks 02
283 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
284 node_name: {{ HOSTNAME_CTL02 }}
285 retry: {count: 1, delay: 30}
286 skip_fail: false
287
288- description: Set disks 03
289 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
290 node_name: {{ HOSTNAME_CTL03 }}
291 retry: {count: 1, delay: 30}
292 skip_fail: false
293
294- description: Create partitions 01
295 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
296 node_name: {{ HOSTNAME_CTL01 }}
297 retry: {count: 1, delay: 30}
298 skip_fail: false
299
300- description: Create partitions 02
301 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300302 node_name: {{ HOSTNAME_CTL02 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300303 retry: {count: 1, delay: 30}
304 skip_fail: false
305
306- description: Create partitions 03
307 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300308 node_name: {{ HOSTNAME_CTL03 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300309 retry: {count: 1, delay: 30}
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300310 skip_fail: false
311
312- description: create volume_group
313 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
314 node_name: {{ HOSTNAME_CFG01 }}
315 retry: {count: 1, delay: 30}
316 skip_fail: false
317
318- description: Install cinder-volume
319 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
320 node_name: {{ HOSTNAME_CFG01 }}
321 retry: {count: 1, delay: 30}
322 skip_fail: false
323
324- description: Install crudini
325 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
326 node_name: {{ HOSTNAME_CFG01 }}
327 retry: {count: 1, delay: 30}
328 skip_fail: false
329
330- description: Temporary WR set enabled backends value 01
331 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
332 node_name: {{ HOSTNAME_CTL01 }}
333 retry: {count: 1, delay: 30}
334 skip_fail: false
335
336- description: Temporary WR set enabled backends value 02
337 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
338 node_name: {{ HOSTNAME_CTL02 }}
339 retry: {count: 1, delay: 30}
340 skip_fail: false
341
342- description: Temporary WR set enabled backends value 03
343 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
344 node_name: {{ HOSTNAME_CTL03 }}
345 retry: {count: 1, delay: 30}
346 skip_fail: false
347
Tatyana Leontovich47f7bfe2018-01-05 13:36:09 +0200348- description: Restart cinder volume
349 cmd: |
350 salt -C 'I@cinder:controller' service.restart cinder-volume;
351 node_name: {{ HOSTNAME_CFG01 }}
352 retry: {count: 2, delay: 5}
353 skip_fail: false
354
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300355- description: Install docker.io on gtw
356 cmd: salt-call cmd.run 'apt-get install docker.io -y'
357 node_name: {{ HOSTNAME_GTW01 }}
358 retry: {count: 1, delay: 30}
359 skip_fail: false
360
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200361- description: Enable forward policy
362 cmd: iptables --policy FORWARD ACCEPT
363 node_name: {{ HOSTNAME_GTW01 }}
364 retry: {count: 1, delay: 30}
365 skip_fail: false
366
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300367- description: create rc file on cfg
368 cmd: scp ctl01:/root/keystonercv3 /root
369 node_name: {{ HOSTNAME_CFG01 }}
370 retry: {count: 1, delay: 30}
371 skip_fail: false
372
373- description: Copy rc file
374 cmd: scp /root/keystonercv3 gtw01:/root
375 node_name: {{ HOSTNAME_CFG01 }}
376 retry: {count: 1, delay: 30}
377 skip_fail: false