blob: 21dafc207d0c7e3259218cce9245893bffb3ab73 [file] [log] [blame]
ibumarskov76aa5c72018-06-13 10:15:37 +04001{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
6{% 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
ibumarskove23c10e2018-08-20 15:47:58 +040011- description: Install glance on primary controller
ibumarskov76aa5c72018-06-13 10:15:37 +040012 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
ibumarskov76aa5c72018-06-13 10:15:37 +040021 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)
26 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 }}
29 retry: {count: 2, delay: 15}
30 skip_fail: false
31
32- 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
44- 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
58- 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 }}
62 retry: {count: 2, delay: 5}
63 skip_fail: false
64
65- description: Check keystone service-list
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
67 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: false
71
72- 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 }}
84 retry: {count: 2, delay: 5}
85 skip_fail: false
86
87- description: Check nova service-list
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 3, delay: 5}
92 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# WORKAROUND PROD-20976
125- description: WORKAROUND PROD-20976
126 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
127 -C 'I@neutron:server or I@neutron:gateway' cmd.run "sed -i
128 's/#min_l3_agents_per_router = 2/min_l3_agents_per_router = 1/'
129 /etc/neutron/neutron.conf"
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 5}
132 skip_fail: false
133
134- description: Restart Neutron services
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
136 -C 'I@neutron:server or I@neutron:gateway' cmd.run 'systemctl restart
137 neutron*'
138 node_name: {{ HOSTNAME_CFG01 }}
139 retry: {count: 1, delay: 5}
140 skip_fail: false
141
142# install designate
ibumarskov76aa5c72018-06-13 10:15:37 +0400143- description: Install powerdns
144 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
145 -C 'I@powerdns:server' state.sls powerdns.server
146 node_name: {{ HOSTNAME_CFG01 }}
147 retry: {count: 1, delay: 5}
148 skip_fail: false
149
150- description: Install designate
151 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
152 -C 'I@designate:server' state.sls designate -b 1
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 5, delay: 10}
155 skip_fail: false
156
157- description: Check neutron agent-list
158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
159 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
160 node_name: {{ HOSTNAME_CFG01 }}
161 retry: {count: 1, delay: 5}
162 skip_fail: false
163
164- description: Install heat service
165 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
166 -C 'I@heat:server' state.sls heat -b 1
167 node_name: {{ HOSTNAME_CFG01 }}
168 retry: {count: 1, delay: 5}
169 skip_fail: false
170
171- description: Deploy horizon dashboard
172 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
173 -C 'I@horizon:server' state.sls horizon
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 1, delay: 5}
176 skip_fail: true
177
178- description: Deploy nginx proxy
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
180 -C 'I@nginx:server' state.sls nginx
181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 5}
183 skip_fail: true
184
185- description: Check heat service
186 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
187 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 5, delay: 10}
190 skip_fail: false
191
192# Install compute node
193
194- description: Apply formulas for compute node
195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
196 node_name: {{ HOSTNAME_CFG01 }}
197 retry: {count: 1, delay: 5}
198 skip_fail: true
199
200- description: Re-apply(as in doc) formulas for compute node
201 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
202 node_name: {{ HOSTNAME_CFG01 }}
203 retry: {count: 1, delay: 5}
204 skip_fail: false
205
206- description: Check IP on computes
207 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
208 'ip a'
209 node_name: {{ HOSTNAME_CFG01 }}
210 retry: {count: 10, delay: 30}
211 skip_fail: false
212
213
214 # Upload cirros image
215
216- description: Upload cirros image on ctl01
217 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400218 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
ibumarskov76aa5c72018-06-13 10:15:37 +0400219 node_name: {{ HOSTNAME_CFG01 }}
220 retry: {count: 2, delay: 30}
221 skip_fail: false
222
223- description: Register image in glance
224 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400225 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2'
ibumarskov76aa5c72018-06-13 10:15:37 +0400226 node_name: {{ HOSTNAME_CFG01 }}
227 retry: {count: 1, delay: 30}
228 skip_fail: false
229
230- description: Create net04_external
231 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
232 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
233 node_name: {{ HOSTNAME_CFG01 }}
234 retry: {count: 1, delay: 30}
235 skip_fail: false
236
237- description: Create subnet_external
238 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
239 '. /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'
240 node_name: {{ HOSTNAME_CFG01 }}
241 retry: {count: 1, delay: 30}
242 skip_fail: false
243
244- description: Create net04
245 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
246 '. /root/keystonercv3; neutron net-create net04'
247 node_name: {{ HOSTNAME_CFG01 }}
248 retry: {count: 1, delay: 30}
249 skip_fail: false
250
251- description: Create subnet_net04
252 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
253 '. /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'
254 node_name: {{ HOSTNAME_CFG01 }}
255 retry: {count: 1, delay: 30}
256 skip_fail: false
257
258- description: Create router
259 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
260 '. /root/keystonercv3; neutron router-create net04_router01'
261 node_name: {{ HOSTNAME_CFG01 }}
262 retry: {count: 1, delay: 30}
263 skip_fail: false
264
ibumarskovc075df82018-07-30 13:23:07 +0400265- description: Set gateway
ibumarskov76aa5c72018-06-13 10:15:37 +0400266 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
267 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
268 node_name: {{ HOSTNAME_CFG01 }}
269 retry: {count: 1, delay: 30}
270 skip_fail: false
271
272- description: Add interface
273 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
274 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
275 node_name: {{ HOSTNAME_CFG01 }}
276 retry: {count: 1, delay: 30}
277 skip_fail: false
278
ibumarskovc075df82018-07-30 13:23:07 +0400279- description: Allow all tcp
280 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
281 '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
282 node_name: {{ HOSTNAME_CFG01 }}
283 retry: {count: 1, delay: 30}
284 skip_fail: false
285
286- description: Allow all icmp
287 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
288 '. /root/keystonercv3; openstack security group rule create --proto icmp default'
289 node_name: {{ HOSTNAME_CFG01 }}
290 retry: {count: 1, delay: 30}
291 skip_fail: false
ibumarskov76aa5c72018-06-13 10:15:37 +0400292
293- description: sync time
294 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
295 'service ntp stop; ntpd -gq; service ntp start'
296 node_name: {{ HOSTNAME_CFG01 }}
297 retry: {count: 1, delay: 30}
298 skip_fail: false
299
300# Configure cinder-volume salt-call
301- description: Set disks 01
302 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
303 node_name: {{ HOSTNAME_CTL01 }}
304 retry: {count: 1, delay: 30}
305 skip_fail: false
306
307- description: Set disks 02
308 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
309 node_name: {{ HOSTNAME_CTL02 }}
310 retry: {count: 1, delay: 30}
311 skip_fail: false
312
313- description: Set disks 03
314 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
315 node_name: {{ HOSTNAME_CTL03 }}
316 retry: {count: 1, delay: 30}
317 skip_fail: false
318
319- description: Create partitions 01
320 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
321 node_name: {{ HOSTNAME_CTL01 }}
322 retry: {count: 1, delay: 30}
323 skip_fail: false
324
325- description: Create partitions 02
326 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
327 node_name: {{ HOSTNAME_CTL02 }}
328 retry: {count: 1, delay: 30}
329 skip_fail: false
330
331- description: Create partitions 03
332 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
333 node_name: {{ HOSTNAME_CTL03 }}
334 retry: {count: 1, delay: 30}
335 skip_fail: false
336
337- description: create volume_group
338 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
339 node_name: {{ HOSTNAME_CFG01 }}
340 retry: {count: 1, delay: 30}
341 skip_fail: false
342
343- description: Install cinder-volume
344 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
345 node_name: {{ HOSTNAME_CFG01 }}
346 retry: {count: 1, delay: 30}
347 skip_fail: false
348
349- description: Install crudini
350 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
351 node_name: {{ HOSTNAME_CFG01 }}
352 retry: {count: 1, delay: 30}
353 skip_fail: false
354
355- description: Temporary WR set enabled backends value 01
356 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
357 node_name: {{ HOSTNAME_CTL01 }}
358 retry: {count: 1, delay: 30}
359 skip_fail: false
360
361- description: Temporary WR set enabled backends value 02
362 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
363 node_name: {{ HOSTNAME_CTL02 }}
364 retry: {count: 1, delay: 30}
365 skip_fail: false
366
367- description: Temporary WR set enabled backends value 03
368 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
369 node_name: {{ HOSTNAME_CTL03 }}
370 retry: {count: 1, delay: 30}
371 skip_fail: false
372
373- description: Restart cinder volume
374 cmd: |
375 salt -C 'I@cinder:controller' service.restart cinder-volume;
376 node_name: {{ HOSTNAME_CFG01 }}
377 retry: {count: 2, delay: 5}
378 skip_fail: false
379
380- description: Install docker.io on gtw
381 cmd: salt-call cmd.run 'apt-get install docker.io -y'
382 node_name: {{ HOSTNAME_GTW01 }}
383 retry: {count: 1, delay: 30}
384 skip_fail: false
385
386- description: Enable forward policy
387 cmd: iptables --policy FORWARD ACCEPT
388 node_name: {{ HOSTNAME_GTW01 }}
389 retry: {count: 1, delay: 30}
390 skip_fail: false
391
392- description: create rc file on cfg
393 cmd: scp ctl01:/root/keystonercv3 /root
394 node_name: {{ HOSTNAME_CFG01 }}
395 retry: {count: 1, delay: 30}
396 skip_fail: false
397
398- description: Copy rc file
399 cmd: scp /root/keystonercv3 gtw01:/root
400 node_name: {{ HOSTNAME_CFG01 }}
401 retry: {count: 1, delay: 30}
402 skip_fail: false