blob: 43c8d16087ab72dc2557e2565c729d1bf6802293 [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
117 # install designate
118- description: Install powerdns
119 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
120 -C 'I@powerdns:server' state.sls powerdns.server
121 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
127 -C 'I@designate:server' state.sls designate -b 1
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 5, delay: 10}
130 skip_fail: false
131
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
139- 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: Deploy horizon dashboard
147 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
148 -C 'I@horizon:server' state.sls horizon
149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 1, delay: 5}
151 skip_fail: true
152
153- description: Deploy nginx proxy
154 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
155 -C 'I@nginx:server' state.sls nginx
156 node_name: {{ HOSTNAME_CFG01 }}
157 retry: {count: 1, delay: 5}
158 skip_fail: true
159
160- description: Check heat service
161 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
162 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 5, delay: 10}
165 skip_fail: false
166
167# 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}
179 skip_fail: false
180
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
187
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
193 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
194 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
200 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img'
201 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
207 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
208 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
240- description: Set geteway
241 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; openstack security group rule create --proto tcp --dst-port 22 default'
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; openstack security group rule create --proto icmp default'
264# node_name: {{ HOSTNAME_CFG01 }}
265# retry: {count: 1, delay: 30}
266# skip_fail: false
267
268- 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
275# 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'
278 node_name: {{ HOSTNAME_CTL01 }}
279 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'
302 node_name: {{ HOSTNAME_CTL02 }}
303 retry: {count: 1, delay: 30}
304 skip_fail: false
305
306- description: Create partitions 03
307 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
308 node_name: {{ HOSTNAME_CTL03 }}
309 retry: {count: 1, delay: 30}
310 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
348- 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
355- 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
361- 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
367- 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