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