blob: cb188b8d630048c8025299c94bd99efde9f40f88 [file] [log] [blame]
Tatyana Leontovichd34f4102018-04-03 17:49:24 +03001{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-offline-pike-ovs-dpdk/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{% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'testing') %}
Tatyana Leontovichd34f4102018-04-03 17:49:24 +03009# Install OpenStack control services
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030010{% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-offline-pike-ovs-dpdk') %}
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +030011{% import 'shared-backup-restore.yaml' as BACKUP with context %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030012{% import 'shared-salt.yaml' as SHARED with context %}
13
14{% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/ubuntu-xenial/docker ' + REPOSITORY_SUITE + ' stable') %}
15
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +030016
Tatyana Leontovichd34f4102018-04-03 17:49:24 +030017- description: Install glance on all controllers
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@glance:server' state.sls glance -b 1
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 5}
22 skip_fail: false
23
24- description: Install keystone service (note that different fernet keys are created on different nodes)
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@keystone:server' state.sls keystone.server -b 1
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 2, delay: 15}
29 skip_fail: false
30
31- description: Restart apache due to PROD-10477
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 15}
35 skip_fail: false
36
37- description: Check apache status to PROD-10477
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 15}
41 skip_fail: false
42
43- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@glance:server' state.sls glusterfs.client
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 1, delay: 5}
48 skip_fail: false
49
50- description: Update fernet keys for keystone server on the mounted glusterfs volume
51 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
52 -C 'I@keystone:server' state.sls keystone.server -b 1
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 5}
55 skip_fail: false
56
57- description: Populate keystone services/tenants/admins
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
59 -C 'I@keystone:client' state.sls keystone.client
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 2, delay: 5}
62 skip_fail: false
63
64- description: Check keystone service-list
65 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
66 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
67 node_name: {{ HOSTNAME_CFG01 }}
68 retry: {count: 1, delay: 5}
69 skip_fail: false
70
71- description: Check glance image-list
72 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
73 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; glance image-list'
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 1, delay: 5}
76 skip_fail: false
77
78
79- description: Install nova on all controllers
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@nova:controller' state.sls nova -b 1
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 2, delay: 5}
84 skip_fail: false
85
86- description: Check nova service-list
87 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
88 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; nova --debug service-list'
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 3, delay: 5}
91 skip_fail: false
92
93
94- description: Install cinder
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@cinder:controller' state.sls cinder -b 1
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 2, delay: 5}
99 skip_fail: false
100
101- description: Check cinder list
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; cinder list'
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 5}
106 skip_fail: false
107
108
109- description: Install neutron service
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@neutron:server' state.sls neutron -b 1
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: false
115
116- description: Install neutron on gtw node
117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
118 -C 'I@neutron:gateway' state.sls neutron
119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 1, delay: 5}
121 skip_fail: false
122
123- description: Install bind if pillars 'bind:server' exists on any server
124 cmd: |
125 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' match.pillar 'bind:server' ; then
126 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' state.sls bind;
127 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@designate:server' state.sls designate -b 1
128 fi
129 node_name: {{ HOSTNAME_CFG01 }}
130 retry: {count: 1, delay: 10}
131 skip_fail: false
132
133- description: Check neutron agent-list
134 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
135 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list'
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 1, delay: 5}
138 skip_fail: false
139
140
141- description: Install heat service
142 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
143 -C 'I@heat:server' state.sls heat -b 1
144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 5}
146 skip_fail: false
147
148- description: Check heat service
149 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
150 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
151 node_name: {{ HOSTNAME_CFG01 }}
152 retry: {count: 5, delay: 10}
153 skip_fail: false
154
155
156- description: Deploy horizon dashboard
157 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
158 -C 'I@horizon:server' state.sls horizon
159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 1, delay: 5}
161 skip_fail: true
162
163- description: Deploy nginx proxy
164 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
165 -C 'I@nginx:server' state.sls nginx
166 node_name: {{ HOSTNAME_CFG01 }}
167 retry: {count: 1, delay: 5}
168 skip_fail: true
169
170
171# Install compute node
172
173- description: Apply 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}
177 skip_fail: true
178
179- description: Re-apply(as in doc) formulas for compute node
180 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 5}
183 skip_fail: false
184
185- description: Check IP on computes
186 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
187 'ip a'
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 10, delay: 30}
190 skip_fail: false
191
Tatyana Leontovichd34f4102018-04-03 17:49:24 +0300192 # 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
336- 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'
347 node_name: {{ HOSTNAME_GTW01 }}
348 retry: {count: 1, delay: 30}
349 skip_fail: false
350
351- 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
359- 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
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +0300370
Tatyana Leontoviche1d16192018-07-18 15:07:51 +0300371{{ BACKUP.MACRO_WR_NGINX_MASTER() }}
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +0300372{{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }}
373{{ BACKUP.MACRO_BACKUP_XTRABACKUP() }}