blob: 1ade409a5979a9f6f0a75951d7ae70ddd2670a33 [file] [log] [blame]
Tatyana Leontovich3c316a12018-01-31 12:42:22 +02001{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-offline-pike-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 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020055 retry: {count: 2, delay: 5}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020056 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/keystonercv3; 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/keystonercv3; 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: 2, 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/keystonercv3; 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
Tatyana Leontoviche98062a2018-02-27 12:34:44 +0200117- description: Install bind if pillars 'bind:server' exists on any server
118 cmd: |
119 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' match.pillar 'bind:server' ; then
120 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' state.sls bind;
121 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@designate:server' state.sls designate -b 1
122 fi
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 10}
125 skip_fail: false
126
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200127- description: Check neutron agent-list
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
129 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list'
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 5}
132 skip_fail: false
133
134
135- description: Install heat service
136 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
137 -C 'I@heat:server' state.sls heat -b 1
138 node_name: {{ HOSTNAME_CFG01 }}
139 retry: {count: 1, delay: 5}
140 skip_fail: false
141
142- description: Check heat service
143 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
144 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
145 node_name: {{ HOSTNAME_CFG01 }}
146 retry: {count: 5, delay: 10}
147 skip_fail: false
148
149
150- description: Deploy horizon dashboard
151 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
152 -C 'I@horizon:server' state.sls horizon
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 1, delay: 5}
155 skip_fail: true
156
157- description: Deploy nginx proxy
158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
159 -C 'I@nginx:server' state.sls nginx
160 node_name: {{ HOSTNAME_CFG01 }}
161 retry: {count: 1, delay: 5}
162 skip_fail: true
163
164
165# Install compute node
166
167- description: Apply formulas for compute node
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 1, delay: 5}
171 skip_fail: true
172
173- description: Re-apply(as in doc) formulas for compute node
174 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
175 node_name: {{ HOSTNAME_CFG01 }}
176 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200177 skip_fail: false
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200178
179- description: Check IP on computes
180 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
181 'ip a'
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 10, delay: 30}
184 skip_fail: false
185
186
187 # Upload cirros image
188# Configure cinder-volume salt-call
189- description: Set disks 01
190 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
191 node_name: {{ HOSTNAME_CTL01 }}
192 retry: {count: 1, delay: 30}
193 skip_fail: false
194
195- description: Set disks 02
196 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
197 node_name: {{ HOSTNAME_CTL02 }}
198 retry: {count: 1, delay: 30}
199 skip_fail: false
200
201- description: Set disks 03
202 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
203 node_name: {{ HOSTNAME_CTL03 }}
204 retry: {count: 1, delay: 30}
205 skip_fail: false
206
207- description: Create partitions 01
208 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
209 node_name: {{ HOSTNAME_CTL01 }}
210 retry: {count: 1, delay: 30}
211 skip_fail: false
212
213- description: Create partitions 02
214 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
215 node_name: {{ HOSTNAME_CTL02 }}
216 retry: {count: 1, delay: 30}
217 skip_fail: false
218
219- description: Create partitions 03
220 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
221 node_name: {{ HOSTNAME_CTL03 }}
222 retry: {count: 1, delay: 30}
223 skip_fail: false
224
225- description: create volume_group
226 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
227 node_name: {{ HOSTNAME_CFG01 }}
228 retry: {count: 1, delay: 30}
229 skip_fail: false
230
231- description: Install cinder-volume
232 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
233 node_name: {{ HOSTNAME_CFG01 }}
234 retry: {count: 1, delay: 30}
235 skip_fail: false
236
237- description: Install crudini
238 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 1, delay: 30}
241 skip_fail: false
242
243- description: Temporary WR set enabled backends value 01
244 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
245 node_name: {{ HOSTNAME_CTL01 }}
246 retry: {count: 1, delay: 30}
247 skip_fail: false
248
249- description: Temporary WR set enabled backends value 02
250 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
251 node_name: {{ HOSTNAME_CTL02 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false
254
255- description: Temporary WR set enabled backends value 03
256 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
257 node_name: {{ HOSTNAME_CTL03 }}
258 retry: {count: 1, delay: 30}
259 skip_fail: false
260
261- description: Restart cinder volume
262 cmd: |
263 salt -C 'I@cinder:controller' service.restart cinder-volume;
264 node_name: {{ HOSTNAME_CFG01 }}
265 retry: {count: 2, delay: 5}
266 skip_fail: false
267
268- description: Upload cirros image on ctl01
269 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
270 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
271 node_name: {{ HOSTNAME_CFG01 }}
272 retry: {count: 2, delay: 30}
273 skip_fail: false
274
275- description: Create net04_external
276 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
277 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
278 node_name: {{ HOSTNAME_CFG01 }}
279 retry: {count: 1, delay: 30}
280 skip_fail: false
281
282- description: Create subnet_external
283 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
284 '. /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'
285 node_name: {{ HOSTNAME_CFG01 }}
286 retry: {count: 1, delay: 30}
287 skip_fail: false
288
289- description: Create net04
290 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
291 '. /root/keystonercv3; neutron net-create net04'
292 node_name: {{ HOSTNAME_CFG01 }}
293 retry: {count: 1, delay: 30}
294 skip_fail: false
295
296- description: Create subnet_net04
297 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
298 '. /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'
299 node_name: {{ HOSTNAME_CFG01 }}
300 retry: {count: 1, delay: 30}
301 skip_fail: false
302
303- description: Create router
304 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
305 '. /root/keystonercv3; neutron router-create net04_router01'
306 node_name: {{ HOSTNAME_CFG01 }}
307 retry: {count: 1, delay: 30}
308 skip_fail: false
309
310- description: Set geteway
311 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
312 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
313 node_name: {{ HOSTNAME_CFG01 }}
314 retry: {count: 1, delay: 30}
315 skip_fail: false
316
317- description: Add interface
318 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
319 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
320 node_name: {{ HOSTNAME_CFG01 }}
321 retry: {count: 1, delay: 30}
322 skip_fail: false
323
324- description: sync time
325 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
326 'service ntp stop; ntpd -gq; service ntp start'
327 node_name: {{ HOSTNAME_CFG01 }}
328 retry: {count: 1, delay: 30}
329 skip_fail: false
330
331- description: Install docker.io on gtw
332 cmd: salt-call cmd.run 'apt-get install docker.io -y'
333 node_name: {{ HOSTNAME_GTW01 }}
334 retry: {count: 1, delay: 30}
335 skip_fail: false
336
337- description: create rc file on cfg
338 cmd: scp ctl01:/root/keystonercv3 /root
339 node_name: {{ HOSTNAME_CFG01 }}
340 retry: {count: 1, delay: 30}
341 skip_fail: false
342
343- description: Copy rc file
344 cmd: scp /root/keystonercv3 gtw01:/root
345 node_name: {{ HOSTNAME_CFG01 }}
346 retry: {count: 1, delay: 30}
347 skip_fail: false