blob: 564d7b76efde8935c91a1cd67432847b9d3879d3 [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 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020077 retry: {count: 2, delay: 5}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030078 skip_fail: false
79
80- description: Check keystone service-list
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovichb1488692017-11-22 18:39:51 +020082 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; 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
Tatyana Leontovichb1488692017-11-22 18:39:51 +0200170 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; 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
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300175- description: Deploy horizon dashboard
176 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
177 -C 'I@horizon:server' state.sls horizon
178 node_name: {{ HOSTNAME_CFG01 }}
179 retry: {count: 1, delay: 5}
180 skip_fail: true
181
182- description: Deploy nginx proxy
183 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
184 -C 'I@nginx:server' state.sls nginx
185 node_name: {{ HOSTNAME_CFG01 }}
186 retry: {count: 1, delay: 5}
187 skip_fail: true
188
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300189# Install compute node
190
191- description: Apply formulas for compute node
192 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
193 node_name: {{ HOSTNAME_CFG01 }}
194 retry: {count: 1, delay: 5}
195 skip_fail: true
196
197- description: Re-apply(as in doc) formulas for compute node
198 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
199 node_name: {{ HOSTNAME_CFG01 }}
200 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200201 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +0300202
203- description: Check IP on computes
204 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
205 'ip a'
206 node_name: {{ HOSTNAME_CFG01 }}
207 retry: {count: 10, delay: 30}
208 skip_fail: false
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300209
210
211 # Upload cirros image
212
213- description: Upload cirros image on ctl01
214 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400215 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300216 node_name: {{ HOSTNAME_CFG01 }}
217 retry: {count: 2, delay: 30}
218 skip_fail: false
219
220- description: Register image in glance
221 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400222 '. /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 +0300223 node_name: {{ HOSTNAME_CFG01 }}
224 retry: {count: 1, delay: 30}
225 skip_fail: false
226
227- description: Create net04_external
228 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Tatyana Leontovich674abf82017-07-20 15:44:15 +0300229 '. /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 +0300230 node_name: {{ HOSTNAME_CFG01 }}
231 retry: {count: 1, delay: 30}
232 skip_fail: false
233
234- description: Create subnet_external
235 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
236 '. /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'
237 node_name: {{ HOSTNAME_CFG01 }}
238 retry: {count: 1, delay: 30}
239 skip_fail: false
240
241- description: Create net04
242 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
243 '. /root/keystonercv3; neutron net-create net04'
244 node_name: {{ HOSTNAME_CFG01 }}
245 retry: {count: 1, delay: 30}
246 skip_fail: false
247
248- description: Create subnet_net04
249 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
250 '. /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'
251 node_name: {{ HOSTNAME_CFG01 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false
254
255- description: Create router
256 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
257 '. /root/keystonercv3; neutron router-create net04_router01'
258 node_name: {{ HOSTNAME_CFG01 }}
259 retry: {count: 1, delay: 30}
260 skip_fail: false
261
ibumarskovc075df82018-07-30 13:23:07 +0400262- description: Set gateway
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300263 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
264 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
265 node_name: {{ HOSTNAME_CFG01 }}
266 retry: {count: 1, delay: 30}
267 skip_fail: false
268
269- description: Add interface
270 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
271 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
272 node_name: {{ HOSTNAME_CFG01 }}
273 retry: {count: 1, delay: 30}
274 skip_fail: false
275
276- description: Allow all tcp
277 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
278 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
279 node_name: {{ HOSTNAME_CFG01 }}
280 retry: {count: 1, delay: 30}
281 skip_fail: false
282
283- description: Allow all icmp
284 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
285 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
286 node_name: {{ HOSTNAME_CFG01 }}
287 retry: {count: 1, delay: 30}
288 skip_fail: false
289
Tatyana Leontovichfa31b392017-07-24 18:37:41 +0300290- description: sync time
291 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
292 'service ntp stop; ntpd -gq; service ntp start'
293 node_name: {{ HOSTNAME_CFG01 }}
294 retry: {count: 1, delay: 30}
295 skip_fail: false
296
Tatyana Leontovichfa31b392017-07-24 18:37:41 +0300297# Configure cinder-volume salt-call PROD-13167
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300298- description: Set disks 01
299 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
300 node_name: {{ HOSTNAME_CTL01 }}
301 retry: {count: 1, delay: 30}
302 skip_fail: false
303
304- description: Set disks 02
305 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
306 node_name: {{ HOSTNAME_CTL02 }}
307 retry: {count: 1, delay: 30}
308 skip_fail: false
309
310- description: Set disks 03
311 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
312 node_name: {{ HOSTNAME_CTL03 }}
313 retry: {count: 1, delay: 30}
314 skip_fail: false
315
316- description: Create partitions 01
317 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
318 node_name: {{ HOSTNAME_CTL01 }}
319 retry: {count: 1, delay: 30}
320 skip_fail: false
321
322- description: Create partitions 02
323 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300324 node_name: {{ HOSTNAME_CTL02 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300325 retry: {count: 1, delay: 30}
326 skip_fail: false
327
328- description: Create partitions 03
329 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300330 node_name: {{ HOSTNAME_CTL03 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300331 retry: {count: 1, delay: 30}
Tatyana Leontovich7c97e802017-07-19 17:08:39 +0300332 skip_fail: false
333
334- description: create volume_group
335 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
336 node_name: {{ HOSTNAME_CFG01 }}
337 retry: {count: 1, delay: 30}
338 skip_fail: false
339
340- description: Install cinder-volume
341 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
342 node_name: {{ HOSTNAME_CFG01 }}
343 retry: {count: 1, delay: 30}
344 skip_fail: false
345
346- description: Install crudini
347 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
348 node_name: {{ HOSTNAME_CFG01 }}
349 retry: {count: 1, delay: 30}
350 skip_fail: false
351
352- description: Temporary WR set enabled backends value 01
353 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
354 node_name: {{ HOSTNAME_CTL01 }}
355 retry: {count: 1, delay: 30}
356 skip_fail: false
357
358- description: Temporary WR set enabled backends value 02
359 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
360 node_name: {{ HOSTNAME_CTL02 }}
361 retry: {count: 1, delay: 30}
362 skip_fail: false
363
364- description: Temporary WR set enabled backends value 03
365 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
366 node_name: {{ HOSTNAME_CTL03 }}
367 retry: {count: 1, delay: 30}
368 skip_fail: false
369
370- description: Install docker.io on gtw
371 cmd: salt-call cmd.run 'apt-get install docker.io -y'
372 node_name: {{ HOSTNAME_GTW01 }}
373 retry: {count: 1, delay: 30}
374 skip_fail: false
375
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200376- description: Enable forward policy
377 cmd: iptables --policy FORWARD ACCEPT
378 node_name: {{ HOSTNAME_GTW01 }}
379 retry: {count: 1, delay: 30}
380 skip_fail: false
381
Tatyana Leontovich47f7bfe2018-01-05 13:36:09 +0200382- description: Restart cinder volume
383 cmd: |
384 salt -C 'I@cinder:controller' service.restart cinder-volume;
385 node_name: {{ HOSTNAME_CFG01 }}
386 retry: {count: 2, delay: 5}
387 skip_fail: false
388
Tatyana Leontovich7c97e802017-07-19 17:08:39 +0300389- description: create rc file on cfg
390 cmd: scp ctl01:/root/keystonercv3 /root
391 node_name: {{ HOSTNAME_CFG01 }}
392 retry: {count: 1, delay: 30}
393 skip_fail: false
394
395- description: Copy rc file
396 cmd: scp /root/keystonercv3 gtw01:/root
397 node_name: {{ HOSTNAME_CFG01 }}
398 retry: {count: 1, delay: 30}
399 skip_fail: false