blob: 6aadd3265870dd04d74569a605892b12070a38e4 [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 %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +03006{% from 'virtual-offline-pike-ovs/underlay.yaml' import LAB_CONFIG_NAME with context %}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +02007{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
8{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
Tatyana Leontovich4436f492018-03-21 21:45:31 +02009{% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'testing') %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030010{% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-offline-pike-ovs') %}
11{% import 'shared-backup-restore.yaml' as BACKUP with context %}
12{% import 'shared-salt.yaml' as SHARED with context %}
13{% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/ubuntu-xenial/docker ' + REPOSITORY_SUITE + ' stable') %}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020014# Install OpenStack control services
15
16- description: Install glance on all controllers
17 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
18 -C 'I@glance:server' state.sls glance -b 1
19 node_name: {{ HOSTNAME_CFG01 }}
20 retry: {count: 1, delay: 5}
21 skip_fail: false
22
23- description: Install keystone service (note that different fernet keys are created on different nodes)
24 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
25 -C 'I@keystone:server' state.sls keystone.server -b 1
26 node_name: {{ HOSTNAME_CFG01 }}
27 retry: {count: 2, delay: 15}
28 skip_fail: false
29
30- description: Restart apache due to PROD-10477
31 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
32 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 15}
34 skip_fail: false
35
36- description: Check apache status to PROD-10477
37 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 15}
40 skip_fail: false
41
42- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
43 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
44 -C 'I@glance:server' state.sls glusterfs.client
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 1, delay: 5}
47 skip_fail: false
48
49- description: Update fernet keys for keystone server on the mounted glusterfs volume
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51 -C 'I@keystone:server' state.sls keystone.server -b 1
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 1, delay: 5}
54 skip_fail: false
55
56- description: Populate keystone services/tenants/admins
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@keystone:client' state.sls keystone.client
59 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020060 retry: {count: 2, delay: 5}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020061 skip_fail: false
62
63- description: Check keystone service-list
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
65 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: false
69
70- description: Check glance image-list
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
72 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; glance image-list'
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 5}
75 skip_fail: false
76
77
78- description: Install nova on all controllers
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
80 -C 'I@nova:controller' state.sls nova -b 1
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 2, delay: 5}
83 skip_fail: false
84
85- description: Check nova service-list
86 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
87 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; nova --debug service-list'
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 3, delay: 5}
90 skip_fail: false
91
92
93- description: Install cinder
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
95 -C 'I@cinder:controller' state.sls cinder -b 1
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 2, delay: 5}
98 skip_fail: false
99
100- description: Check cinder list
101 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
102 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; cinder list'
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107
108- description: Install neutron service
109 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
110 -C 'I@neutron:server' state.sls neutron -b 1
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 5}
113 skip_fail: false
114
115- description: Install neutron on gtw node
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
117 -C 'I@neutron:gateway' state.sls neutron
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 5}
120 skip_fail: false
121
Tatyana Leontoviche98062a2018-02-27 12:34:44 +0200122- description: Install bind if pillars 'bind:server' exists on any server
123 cmd: |
124 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' match.pillar 'bind:server' ; then
125 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' state.sls bind;
126 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@designate:server' state.sls designate -b 1
127 fi
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 10}
130 skip_fail: false
131
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200132- description: Check neutron agent-list
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
134 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list'
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 5}
137 skip_fail: false
138
139
140- description: Install heat service
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
142 -C 'I@heat:server' state.sls heat -b 1
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 5}
145 skip_fail: false
146
147- description: Check heat service
148 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
149 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
150 node_name: {{ HOSTNAME_CFG01 }}
151 retry: {count: 5, delay: 10}
152 skip_fail: false
153
154
155- description: Deploy horizon dashboard
156 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
157 -C 'I@horizon:server' state.sls horizon
158 node_name: {{ HOSTNAME_CFG01 }}
159 retry: {count: 1, delay: 5}
160 skip_fail: true
161
162- description: Deploy nginx proxy
163 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
164 -C 'I@nginx:server' state.sls nginx
165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 1, delay: 5}
167 skip_fail: true
168
169
170# Install compute node
171
172- description: Apply formulas for compute node
173 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 1, delay: 5}
176 skip_fail: true
177
178- description: Re-apply(as in doc) formulas for compute node
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
180 node_name: {{ HOSTNAME_CFG01 }}
181 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200182 skip_fail: false
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200183
184- description: Check IP on computes
185 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
186 'ip a'
187 node_name: {{ HOSTNAME_CFG01 }}
188 retry: {count: 10, delay: 30}
189 skip_fail: false
190
191
192 # Upload cirros image
193# Configure cinder-volume salt-call
194- description: Set disks 01
195 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
196 node_name: {{ HOSTNAME_CTL01 }}
197 retry: {count: 1, delay: 30}
198 skip_fail: false
199
200- description: Set disks 02
201 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
202 node_name: {{ HOSTNAME_CTL02 }}
203 retry: {count: 1, delay: 30}
204 skip_fail: false
205
206- description: Set disks 03
207 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
208 node_name: {{ HOSTNAME_CTL03 }}
209 retry: {count: 1, delay: 30}
210 skip_fail: false
211
212- description: Create partitions 01
213 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
214 node_name: {{ HOSTNAME_CTL01 }}
215 retry: {count: 1, delay: 30}
216 skip_fail: false
217
218- description: Create partitions 02
219 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
220 node_name: {{ HOSTNAME_CTL02 }}
221 retry: {count: 1, delay: 30}
222 skip_fail: false
223
224- description: Create partitions 03
225 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
226 node_name: {{ HOSTNAME_CTL03 }}
227 retry: {count: 1, delay: 30}
228 skip_fail: false
229
230- description: create volume_group
231 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 1, delay: 30}
234 skip_fail: false
235
236- description: Install cinder-volume
237 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
238 node_name: {{ HOSTNAME_CFG01 }}
239 retry: {count: 1, delay: 30}
240 skip_fail: false
241
242- description: Install crudini
243 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
244 node_name: {{ HOSTNAME_CFG01 }}
245 retry: {count: 1, delay: 30}
246 skip_fail: false
247
248- description: Temporary WR set enabled backends value 01
249 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
250 node_name: {{ HOSTNAME_CTL01 }}
251 retry: {count: 1, delay: 30}
252 skip_fail: false
253
254- description: Temporary WR set enabled backends value 02
255 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
256 node_name: {{ HOSTNAME_CTL02 }}
257 retry: {count: 1, delay: 30}
258 skip_fail: false
259
260- description: Temporary WR set enabled backends value 03
261 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
262 node_name: {{ HOSTNAME_CTL03 }}
263 retry: {count: 1, delay: 30}
264 skip_fail: false
265
266- description: Restart cinder volume
267 cmd: |
268 salt -C 'I@cinder:controller' service.restart cinder-volume;
269 node_name: {{ HOSTNAME_CFG01 }}
270 retry: {count: 2, delay: 5}
271 skip_fail: false
272
273- description: Upload cirros image on ctl01
274 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
275 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
276 node_name: {{ HOSTNAME_CFG01 }}
277 retry: {count: 2, delay: 30}
278 skip_fail: false
279
280- description: Create net04_external
281 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
282 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
283 node_name: {{ HOSTNAME_CFG01 }}
284 retry: {count: 1, delay: 30}
285 skip_fail: false
286
287- description: Create subnet_external
288 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
289 '. /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'
290 node_name: {{ HOSTNAME_CFG01 }}
291 retry: {count: 1, delay: 30}
292 skip_fail: false
293
294- description: Create net04
295 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
296 '. /root/keystonercv3; neutron net-create net04'
297 node_name: {{ HOSTNAME_CFG01 }}
298 retry: {count: 1, delay: 30}
299 skip_fail: false
300
301- description: Create subnet_net04
302 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
303 '. /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'
304 node_name: {{ HOSTNAME_CFG01 }}
305 retry: {count: 1, delay: 30}
306 skip_fail: false
307
308- description: Create router
309 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
310 '. /root/keystonercv3; neutron router-create net04_router01'
311 node_name: {{ HOSTNAME_CFG01 }}
312 retry: {count: 1, delay: 30}
313 skip_fail: false
314
315- description: Set geteway
316 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
317 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
318 node_name: {{ HOSTNAME_CFG01 }}
319 retry: {count: 1, delay: 30}
320 skip_fail: false
321
322- description: Add interface
323 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
324 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
325 node_name: {{ HOSTNAME_CFG01 }}
326 retry: {count: 1, delay: 30}
327 skip_fail: false
328
329- description: sync time
330 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
331 'service ntp stop; ntpd -gq; service ntp start'
332 node_name: {{ HOSTNAME_CFG01 }}
333 retry: {count: 1, delay: 30}
334 skip_fail: false
335
Tatyana Leontovich4436f492018-03-21 21:45:31 +0200336- description: Enable local docker repo
337 cmd: |
338 set -e;
339 echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list;
340 apt-get clean; apt-get update;
341 node_name: {{ HOSTNAME_GTW01 }}
342 retry: {count: 1, delay: 30}
343 skip_fail: false
344
345- description: Install docker-ce on gtw
346 cmd: salt-call cmd.run 'apt-get install docker-ce -y'
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200347 node_name: {{ HOSTNAME_GTW01 }}
348 retry: {count: 1, delay: 30}
349 skip_fail: false
350
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200351- description: Enable forward policy on gtw
352 cmd: |
353 set -e;
354 iptables --policy FORWARD ACCEPT;
355 node_name: {{ HOSTNAME_GTW01 }}
356 retry: {count: 1, delay: 30}
357 skip_fail: false
358
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200359- description: create rc file on cfg
360 cmd: scp ctl01:/root/keystonercv3 /root
361 node_name: {{ HOSTNAME_CFG01 }}
362 retry: {count: 1, delay: 30}
363 skip_fail: false
364
365- description: Copy rc file
366 cmd: scp /root/keystonercv3 gtw01:/root
367 node_name: {{ HOSTNAME_CFG01 }}
368 retry: {count: 1, delay: 30}
369 skip_fail: false