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