blob: 21d5afe8bce39d66a01f7086650038fd34d80412 [file] [log] [blame]
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03001{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
Tatyana Leontovich6238ba52017-06-22 19:31:56 +03002{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %}
Tatyana Leontovich7c97e802017-07-19 17:08:39 +03005{% from 'virtual-mcp-ocata-dvr/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 %}
Dmitry Tyzhnenko8f6a63e2017-09-05 15:37:23 +03008{% set LAB_CONFIG_NAME = os_env('LAB_CONFIG_NAME') %}
Tatyana Leontovichd08f8812017-11-09 12:52:21 +02009{% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030010
11# Install OpenStack control services
12
Tatyana Leontovichd08f8812017-11-09 12:52:21 +020013{%- if OVERRIDE_POLICY != '' %}
Dmitry Tyzhnenko8f6a63e2017-09-05 15:37:23 +030014- description: Upload policy override
15 upload:
16 local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
17 local_filename: overrides-policy.yml
18 remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/
19 node_name: {{ HOSTNAME_CFG01 }}
20
21- description: Create custom cluster control class
22 cmd: echo -e "classes:\n- cluster.{{ LAB_CONFIG_NAME }}.openstack.control_orig\n$(cat /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml)" > /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml
23 node_name: {{ HOSTNAME_CFG01 }}
24
25- description: Rename control classes
26 cmd: mv /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_orig.yml &&
27 ln -s /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml &&
28 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all &&
29 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
30 node_name: {{ HOSTNAME_CFG01 }}
Dmitry Tyzhnenko33eea152017-11-02 23:25:09 +020031{%- endif %}
Dmitry Tyzhnenko8f6a63e2017-09-05 15:37:23 +030032
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030033- description: Install glance on all controllers
34 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
35 -C 'I@glance:server' state.sls glance -b 1
36 node_name: {{ HOSTNAME_CFG01 }}
37 retry: {count: 1, delay: 5}
38 skip_fail: false
39
40- description: Install keystone service (note that different fernet keys are created on different nodes)
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030041 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
42 -C 'I@keystone:server' state.sls keystone.server -b 1
43 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovichd4f1fd32017-04-21 13:31:44 +030044 retry: {count: 2, delay: 15}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030045 skip_fail: false
46
Tatyana Leontovichfa7ae4d2017-04-25 13:46:14 +030047- description: Restart apache due to PROD-10477
48 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
49 node_name: {{ HOSTNAME_CFG01 }}
50 retry: {count: 1, delay: 15}
51 skip_fail: false
52
53- description: Check apache status to PROD-10477
54 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 15}
57 skip_fail: false
58
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030059- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'I@glance:server' state.sls glusterfs.client
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: false
65
66- description: Update fernet keys for keystone server on the mounted glusterfs volume
67 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
68 -C 'I@keystone:server' state.sls keystone.server -b 1
69 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 1, delay: 5}
71 skip_fail: false
72
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030073- description: Populate keystone services/tenants/admins
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
75 -C 'I@keystone:client' state.sls keystone.client
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 5}
78 skip_fail: false
79
80- description: Check keystone service-list
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb8b02d82017-04-21 14:07:33 +030082 -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030083 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 5}
85 skip_fail: false
86
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030087- description: Check glance image-list
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 5}
92 skip_fail: false
93
94
95- description: Install nova on all controllers
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
97 -C 'I@nova:controller' state.sls nova -b 1
98 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030099 retry: {count: 2, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300100 skip_fail: false
101
102- description: Check nova service-list
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich902f1b42017-07-27 17:00:19 +0300104 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300105 node_name: {{ HOSTNAME_CFG01 }}
Tatyana Leontovich902f1b42017-07-27 17:00:19 +0300106 retry: {count: 3, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300107 skip_fail: false
108
109
110- description: Install cinder
111 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
112 -C 'I@cinder:controller' state.sls cinder -b 1
113 node_name: {{ HOSTNAME_CFG01 }}
114 retry: {count: 1, delay: 5}
115 skip_fail: false
116
117- description: Check cinder list
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
119 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: false
123
124
125- description: Install neutron service
126 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
127 -C 'I@neutron:server' state.sls neutron -b 1
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 5}
130 skip_fail: false
131
132- description: Install neutron on gtw node
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
134 -C 'I@neutron:gateway' state.sls neutron
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 5}
137 skip_fail: false
138
Tatyana Leontovichc33be1f2017-07-19 17:38:30 +0300139# isntall designate
140- description: Install powerdns
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich8d815a82017-10-05 16:01:26 +0300142 -C 'I@powerdns:server' state.sls powerdns.server
Tatyana Leontovichc33be1f2017-07-19 17:38:30 +0300143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 5}
145 skip_fail: false
146
147- description: Install designate
148 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
149 -C 'I@designate:server' state.sls designate -b 1
150 node_name: {{ HOSTNAME_CFG01 }}
151 retry: {count: 5, delay: 10}
152 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300153
154- description: Check neutron agent-list
155 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
156 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
157 node_name: {{ HOSTNAME_CFG01 }}
158 retry: {count: 1, delay: 5}
159 skip_fail: false
160
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300161- description: Install heat service
162 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
163 -C 'I@heat:server' state.sls heat -b 1
164 node_name: {{ HOSTNAME_CFG01 }}
165 retry: {count: 1, delay: 5}
166 skip_fail: false
167
168- description: Check heat service
169 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Igor Yozhikov8ec6d2f2017-05-23 16:17:29 +0300170 -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list'
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300171 node_name: {{ HOSTNAME_CFG01 }}
Igor Yozhikov8ec6d2f2017-05-23 16:17:29 +0300172 retry: {count: 5, delay: 10}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300173 skip_fail: false
174
175
176- description: Deploy horizon dashboard
177 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
178 -C 'I@horizon:server' state.sls horizon
179 node_name: {{ HOSTNAME_CFG01 }}
180 retry: {count: 1, delay: 5}
181 skip_fail: true
182
183- description: Deploy nginx proxy
184 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
185 -C 'I@nginx:server' state.sls nginx
186 node_name: {{ HOSTNAME_CFG01 }}
187 retry: {count: 1, delay: 5}
188 skip_fail: true
189
190
191# Install compute node
192
193- description: Apply formulas for compute node
194 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
195 node_name: {{ HOSTNAME_CFG01 }}
196 retry: {count: 1, delay: 5}
197 skip_fail: true
198
199- description: Re-apply(as in doc) formulas for compute node
200 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
201 node_name: {{ HOSTNAME_CFG01 }}
202 retry: {count: 1, delay: 5}
203 skip_fail: true
204
205- description: Check IP on computes
206 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
207 'ip a'
208 node_name: {{ HOSTNAME_CFG01 }}
209 retry: {count: 10, delay: 30}
210 skip_fail: false
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300211
212
213 # Upload cirros image
214
215- description: Upload cirros image on ctl01
216 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
217 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
218 node_name: {{ HOSTNAME_CFG01 }}
219 retry: {count: 2, delay: 30}
220 skip_fail: false
221
222- description: Register image in glance
223 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
224 '. /root/keystonercv3; glance image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img'
225 node_name: {{ HOSTNAME_CFG01 }}
226 retry: {count: 1, delay: 30}
227 skip_fail: false
228
229- description: Create net04_external
230 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Tatyana Leontovich674abf82017-07-20 15:44:15 +0300231 '. /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 +0300232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 1, delay: 30}
234 skip_fail: false
235
236- description: Create subnet_external
237 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
238 '. /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'
239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 1, delay: 30}
241 skip_fail: false
242
243- description: Create net04
244 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
245 '. /root/keystonercv3; neutron net-create net04'
246 node_name: {{ HOSTNAME_CFG01 }}
247 retry: {count: 1, delay: 30}
248 skip_fail: false
249
250- description: Create subnet_net04
251 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
252 '. /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'
253 node_name: {{ HOSTNAME_CFG01 }}
254 retry: {count: 1, delay: 30}
255 skip_fail: false
256
257- description: Create router
258 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
259 '. /root/keystonercv3; neutron router-create net04_router01'
260 node_name: {{ HOSTNAME_CFG01 }}
261 retry: {count: 1, delay: 30}
262 skip_fail: false
263
264- description: Set geteway
265 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
266 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
267 node_name: {{ HOSTNAME_CFG01 }}
268 retry: {count: 1, delay: 30}
269 skip_fail: false
270
271- description: Add interface
272 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
273 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
274 node_name: {{ HOSTNAME_CFG01 }}
275 retry: {count: 1, delay: 30}
276 skip_fail: false
277
278- description: Allow all tcp
279 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
280 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
281 node_name: {{ HOSTNAME_CFG01 }}
282 retry: {count: 1, delay: 30}
283 skip_fail: false
284
285- description: Allow all icmp
286 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
287 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
288 node_name: {{ HOSTNAME_CFG01 }}
289 retry: {count: 1, delay: 30}
290 skip_fail: false
291
Tatyana Leontovichfa31b392017-07-24 18:37:41 +0300292- description: sync time
293 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
294 'service ntp stop; ntpd -gq; service ntp start'
295 node_name: {{ HOSTNAME_CFG01 }}
296 retry: {count: 1, delay: 30}
297 skip_fail: false
298
Tatyana Leontovichfa31b392017-07-24 18:37:41 +0300299# Configure cinder-volume salt-call PROD-13167
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300300- description: Set disks 01
301 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
302 node_name: {{ HOSTNAME_CTL01 }}
303 retry: {count: 1, delay: 30}
304 skip_fail: false
305
306- description: Set disks 02
307 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
308 node_name: {{ HOSTNAME_CTL02 }}
309 retry: {count: 1, delay: 30}
310 skip_fail: false
311
312- description: Set disks 03
313 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
314 node_name: {{ HOSTNAME_CTL03 }}
315 retry: {count: 1, delay: 30}
316 skip_fail: false
317
318- description: Create partitions 01
319 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
320 node_name: {{ HOSTNAME_CTL01 }}
321 retry: {count: 1, delay: 30}
322 skip_fail: false
323
324- description: Create partitions 02
325 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300326 node_name: {{ HOSTNAME_CTL02 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300327 retry: {count: 1, delay: 30}
328 skip_fail: false
329
330- description: Create partitions 03
331 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300332 node_name: {{ HOSTNAME_CTL03 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300333 retry: {count: 1, delay: 30}
Tatyana Leontovich7c97e802017-07-19 17:08:39 +0300334 skip_fail: false
335
336- description: create volume_group
337 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
338 node_name: {{ HOSTNAME_CFG01 }}
339 retry: {count: 1, delay: 30}
340 skip_fail: false
341
342- description: Install cinder-volume
343 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
344 node_name: {{ HOSTNAME_CFG01 }}
345 retry: {count: 1, delay: 30}
346 skip_fail: false
347
348- description: Install crudini
349 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
350 node_name: {{ HOSTNAME_CFG01 }}
351 retry: {count: 1, delay: 30}
352 skip_fail: false
353
354- description: Temporary WR set enabled backends value 01
355 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
356 node_name: {{ HOSTNAME_CTL01 }}
357 retry: {count: 1, delay: 30}
358 skip_fail: false
359
360- description: Temporary WR set enabled backends value 02
361 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
362 node_name: {{ HOSTNAME_CTL02 }}
363 retry: {count: 1, delay: 30}
364 skip_fail: false
365
366- description: Temporary WR set enabled backends value 03
367 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
368 node_name: {{ HOSTNAME_CTL03 }}
369 retry: {count: 1, delay: 30}
370 skip_fail: false
371
372- description: Install docker.io on gtw
373 cmd: salt-call cmd.run 'apt-get install docker.io -y'
374 node_name: {{ HOSTNAME_GTW01 }}
375 retry: {count: 1, delay: 30}
376 skip_fail: false
377
378- description: create rc file on cfg
379 cmd: scp ctl01:/root/keystonercv3 /root
380 node_name: {{ HOSTNAME_CFG01 }}
381 retry: {count: 1, delay: 30}
382 skip_fail: false
383
384- description: Copy rc file
385 cmd: scp /root/keystonercv3 gtw01:/root
386 node_name: {{ HOSTNAME_CFG01 }}
387 retry: {count: 1, delay: 30}
388 skip_fail: false