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