blob: e84ed31301ca6a520fffd60ba5c6a83080e59c4b [file] [log] [blame]
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +03001{% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-offline-ssl/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-offline-ssl/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 %}
Tatyana Leontovich69700712018-04-23 12:26:57 +03008
Tatyana Leontovich89475582018-04-24 12:35:02 +03009{% from 'virtual-offline-ssl/underlay.yaml' import LAB_CONFIG_NAME with context %}
10{% from 'virtual-offline-ssl/underlay.yaml' import DOMAIN_NAME with context %}
Tatyana Leontovich69700712018-04-23 12:26:57 +030011
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030012{% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'proposed') %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030013{% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-offline-ssl') %}
Tatyana Leontovichbb29d1d2018-06-19 13:23:04 +030014{% import 'shared-backup-restore.yaml' as BACKUP with context %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030015{% import 'shared-salt.yaml' as SHARED with context %}
Dennis Dmitriev4034db02018-08-26 21:50:13 +030016{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030017
Tatyana Leontovicheae32052018-10-24 22:28:18 +030018{% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/' + REPOSITORY_SUITE + '/docker/xenial xenial stable') %}
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030019
20# Install OpenStack control services
21
22- description: Nginx
23 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
24 -C 'I@nginx:server' state.sls salt.minion
25 node_name: {{ HOSTNAME_CFG01 }}
26 retry: {count: 1, delay: 5}
27 skip_fail: true
28
29- description: Deploy nginx proxy
30 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
31 -C 'I@nginx:server' state.sls nginx
32 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 5}
34 skip_fail: true
35
sgudz62df2fc2018-10-09 12:26:19 +030036{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030037
Dennis Dmitriev4034db02018-08-26 21:50:13 +030038{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030039
Dennis Dmitriev4034db02018-08-26 21:50:13 +030040{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030041
Dennis Dmitriev4034db02018-08-26 21:50:13 +030042{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030043
Dennis Dmitriev4034db02018-08-26 21:50:13 +030044{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030045
46## isntall designate
47#- description: Install bind
48# cmd: salt --hard-crash --state-output=mixed --state-verbose=False
49# -C 'I@bind:server' state.sls bind
50# node_name: {{ HOSTNAME_CFG01 }}
51# retry: {count: 1, delay: 5}
52# skip_fail: false
53#
54#- description: Install designate
55# cmd: salt --hard-crash --state-output=mixed --state-verbose=False
56# -C 'I@designate:server' state.sls designate -b 1
57# node_name: {{ HOSTNAME_CFG01 }}
58# retry: {count: 5, delay: 10}
59# skip_fail: false
60
Dennis Dmitriev4034db02018-08-26 21:50:13 +030061{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030062
63# Install Telemetry services (mdb nodes)
64- description: Install redis service
65 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:cluster:role:master' state.sls redis &&
66 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:server' state.sls redis
67 node_name: {{ HOSTNAME_CFG01 }}
68 retry: {count: 1, delay: 5}
69 skip_fail: false
70
71- description: Install gnocchi server
72 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server and *01*' state.sls gnocchi.server &&
73 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server' state.sls gnocchi.server
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 1, delay: 5}
76 skip_fail: false
77
Dennis Dmitriev85145a62018-08-03 19:22:08 +030078- description: Setup gnocchi client
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client and *01*' state.sls gnocchi.client &&
80 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client' state.sls gnocchi.client
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 1, delay: 5}
83 skip_fail: false
84
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +030085#- description: Install gnocchi statsd (optional)
86# cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:statsd and *01*' state.sls gnocchi.statsd &&
87# salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:statsd' state.sls gnocchi.statsd
88# node_name: {{ HOSTNAME_CFG01 }}
89# retry: {count: 1, delay: 5}
90# skip_fail: false
91
92- description: Install panko server
93 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server and *01*' state.sls panko &&
94 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server' state.sls panko
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 1, delay: 5}
97 skip_fail: false
98
99- description: Install ceilometer server on first node
100 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server and *01*' state.sls ceilometer
101 node_name: {{ HOSTNAME_CFG01 }}
102 retry: {count: 2, delay: 5}
103 skip_fail: false
104
105- description: Install ceilometer server on other nodes
106 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server' state.sls ceilometer
107 node_name: {{ HOSTNAME_CFG01 }}
108 retry: {count: 2, delay: 5}
109 skip_fail: false
110
111- description: Install aodh server
112 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server and *01*' state.sls aodh &&
113 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server' state.sls aodh
114 node_name: {{ HOSTNAME_CFG01 }}
115 retry: {count: 1, delay: 5}
116 skip_fail: false
117
118# Install OpenStack dashboard and proxy services
119- description: Deploy horizon dashboard
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
121 -C 'I@horizon:server' state.sls horizon
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 5}
124 skip_fail: true
125
126- description: Deploy nginx proxy
127 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
128 -C 'I@nginx:server' state.sls nginx
129 node_name: {{ HOSTNAME_CFG01 }}
130 retry: {count: 1, delay: 5}
131 skip_fail: true
132
133- description: Install manila-api on first node
134 cmd: |
135 salt -C 'I@manila:api and *01*' state.sls manila.api;
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 1, delay: 5}
138 skip_fail: false
139
140- description: Install manila-api on other nodes
141 cmd: |
142 salt -C 'I@manila:api and not *01*' state.sls manila.api;
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 5}
145 skip_fail: false
146
147- description: Install manila-scheduler
148 cmd: |
149 salt -C 'I@manila:scheduler' state.sls manila.scheduler;
150 node_name: {{ HOSTNAME_CFG01 }}
151 retry: {count: 1, delay: 5}
152 skip_fail: false
153
154- description: Install manila-share
155 cmd: |
156 salt -C 'I@manila:share' state.sls manila.share;
157 node_name: {{ HOSTNAME_CFG01 }}
158 retry: {count: 1, delay: 5}
159 skip_fail: false
160
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +0300161- description: Check manila-services
162 cmd: |
163 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list'
164 node_name: {{ HOSTNAME_CFG01 }}
Oleksii Butenko3deb90e2018-04-06 15:34:38 +0300165 retry: {count: 3, delay: 5}
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +0300166 skip_fail: false
167
Maksym Shalamovae15a772018-07-20 13:13:29 +0300168- description: Create manila type
169 cmd: |
170 salt 'cfg01*' state.sls manila.client
171 node_name: {{ HOSTNAME_CFG01 }}
172 retry: {count: 1, delay: 5}
173 skip_fail: false
174
Tatyana Leontovich69700712018-04-23 12:26:57 +0300175- description: Create CIFS and NFS share and check it status
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +0300176 cmd: |
Tatyana Leontovich69700712018-04-23 12:26:57 +0300177 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default';
178 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default';
179 sleep 5;
180 salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list';
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +0300181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 5}
183 skip_fail: false
184
185# Install DogTag server service
186- description: Install DogTag server service
187 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
188 -C 'I@dogtag:server and *01*' state.sls dogtag.server
189 node_name: {{ HOSTNAME_CFG01 }}
190 retry: {count: 1, delay: 5}
191 skip_fail: false
192
193- description: Install DogTag server service
194 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
195 -C 'I@dogtag:server' state.sls dogtag.server
196 node_name: {{ HOSTNAME_CFG01 }}
197 retry: {count: 1, delay: 5}
198 skip_fail: false
199
200# Install Barbican server service
201- description: Install Barbican server service
202 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
203 -C 'I@barbican:server and *01*' state.sls barbican.server
204 node_name: {{ HOSTNAME_CFG01 }}
205 retry: {count: 1, delay: 5}
206 skip_fail: false
207
208- description: Install Barbican server service
209 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
210 -C 'I@barbican:server' state.sls barbican.server
211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 1, delay: 5}
213 skip_fail: false
214
215- description: Install Barbican client
216 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
217 -C 'I@barbican:client' state.sls barbican.client
218 node_name: {{ HOSTNAME_CFG01 }}
219 retry: {count: 1, delay: 5}
220 skip_fail: True
221
222# Install compute node
223
224- description: Apply formulas for compute node
225 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
226 node_name: {{ HOSTNAME_CFG01 }}
227 retry: {count: 1, delay: 5}
228 skip_fail: true
229
230- description: Re-apply(as in doc) formulas for compute node
231 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 1, delay: 5}
234 skip_fail: false
235
236- description: Check IP on computes
237 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
238 'ip a'
239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 10, delay: 30}
241 skip_fail: false
242
243# Configure cinder-volume salt-call
244#- description: Set disks 01
245# cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
246# node_name: {{ HOSTNAME_CTL01 }}
247# retry: {count: 1, delay: 30}
248# skip_fail: false
249#
250#- description: Set disks 02
251# cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
252# node_name: {{ HOSTNAME_CTL02 }}
253# retry: {count: 1, delay: 30}
254# skip_fail: false
255#
256#- description: Set disks 03
257# cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
258# node_name: {{ HOSTNAME_CTL03 }}
259# retry: {count: 1, delay: 30}
260# skip_fail: false
261#
262#- description: Create partitions 01
263# cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
264# node_name: {{ HOSTNAME_CTL01 }}
265# retry: {count: 1, delay: 30}
266# skip_fail: false
267#
268#- description: Create partitions 02
269# cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
270# node_name: {{ HOSTNAME_CTL02 }}
271# retry: {count: 1, delay: 30}
272# skip_fail: false
273#
274#- description: Create partitions 03
275# cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
276# node_name: {{ HOSTNAME_CTL03 }}
277# retry: {count: 1, delay: 30}
278# skip_fail: false
279#
280#- description: create volume_group
281# cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
282# node_name: {{ HOSTNAME_CFG01 }}
283# retry: {count: 1, delay: 30}
284# skip_fail: false
285#
286#- description: Install cinder-volume
287# cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
288# node_name: {{ HOSTNAME_CFG01 }}
289# retry: {count: 1, delay: 30}
290# skip_fail: false
291#
292#- description: Install crudini
293# cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
294# node_name: {{ HOSTNAME_CFG01 }}
295# retry: {count: 1, delay: 30}
296# skip_fail: false
297#
298#- description: Temporary WR set enabled backends value 01
299# cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
300# node_name: {{ HOSTNAME_CTL01 }}
301# retry: {count: 1, delay: 30}
302# skip_fail: false
303#
304#- description: Temporary WR set enabled backends value 02
305# cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
306# node_name: {{ HOSTNAME_CTL02 }}
307# retry: {count: 1, delay: 30}
308# skip_fail: false
309#
310#- description: Temporary WR set enabled backends value 03
311# cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
312# node_name: {{ HOSTNAME_CTL03 }}
313# retry: {count: 1, delay: 30}
314# skip_fail: false
315#
316#- description: Restart cinder volume
317# cmd: |
318# salt -C 'I@cinder:controller' service.restart cinder-volume;
319# node_name: {{ HOSTNAME_CFG01 }}
320# retry: {count: 2, delay: 5}
321# skip_fail: false
322#
323- description: Upload cirros image on ctl01
324 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
325 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
326 node_name: {{ HOSTNAME_CFG01 }}
327 retry: {count: 2, delay: 30}
328 skip_fail: false
329
330- description: Create net04_external
331 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
332 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
333 node_name: {{ HOSTNAME_CFG01 }}
334 retry: {count: 1, delay: 30}
335 skip_fail: false
336
337- description: Create subnet_external
338 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
339 '. /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'
340 node_name: {{ HOSTNAME_CFG01 }}
341 retry: {count: 1, delay: 30}
342 skip_fail: false
343
344- description: Create net04
345 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
346 '. /root/keystonercv3; neutron net-create net04'
347 node_name: {{ HOSTNAME_CFG01 }}
348 retry: {count: 1, delay: 30}
349 skip_fail: false
350
351- description: Create subnet_net04
352 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
353 '. /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'
354 node_name: {{ HOSTNAME_CFG01 }}
355 retry: {count: 1, delay: 30}
356 skip_fail: false
357
358- description: Create router
359 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
360 '. /root/keystonercv3; neutron router-create net04_router01'
361 node_name: {{ HOSTNAME_CFG01 }}
362 retry: {count: 1, delay: 30}
363 skip_fail: false
364
365- description: Set geteway
366 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
367 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
368 node_name: {{ HOSTNAME_CFG01 }}
369 retry: {count: 1, delay: 30}
370 skip_fail: false
371
372- description: Add interface
373 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
374 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
375 node_name: {{ HOSTNAME_CFG01 }}
376 retry: {count: 1, delay: 30}
377 skip_fail: false
378
379- description: sync time
380 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
381 'service ntp stop; ntpd -gq; service ntp start'
382 node_name: {{ HOSTNAME_CFG01 }}
383 retry: {count: 1, delay: 30}
384 skip_fail: false
385
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +0300386
Tatyana Leontovich50e62dd2018-03-28 20:59:52 +0300387- description: Enable local docker repo
388 cmd: |
389 set -e;
390 echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list;
391 apt-get clean; apt-get update;
392 node_name: {{ HOSTNAME_GTW01 }}
393 retry: {count: 1, delay: 30}
394 skip_fail: false
395
396- description: Install docker-ce on gtw
397 cmd: salt-call cmd.run 'apt-get install docker-ce -y'
398 node_name: {{ HOSTNAME_GTW01 }}
399 retry: {count: 1, delay: 30}
400 skip_fail: false
401
402- description: Enable forward policy on gtw
403 cmd: |
404 set -e;
405 iptables --policy FORWARD ACCEPT;
406 node_name: {{ HOSTNAME_GTW01 }}
407 retry: {count: 1, delay: 30}
408 skip_fail: false
409
410- description: create rc file on cfg
411 cmd: scp ctl01:/root/keystonercv3 /root
412 node_name: {{ HOSTNAME_CFG01 }}
413 retry: {count: 1, delay: 30}
414 skip_fail: false
415
416- description: Copy rc file
417 cmd: scp /root/keystonercv3 gtw01:/root
418 node_name: {{ HOSTNAME_CFG01 }}
419 retry: {count: 1, delay: 30}
420 skip_fail: false