blob: 032a78a12a5bcc485bdc8599eddf0c9d6978d629 [file] [log] [blame]
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +02001{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'cookied-mcp-pike-dvr/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 LAB_CONFIG_NAME = os_env('LAB_CONFIG_NAME') %}
9{% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %}
10
Oleksii Butenko5cd0a162018-06-14 18:18:10 +030011{% import 'shared-salt.yaml' as SHARED with context %}
12
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020013# Install OpenStack control services
14
15{%- if OVERRIDE_POLICY != '' %}
16- description: Upload policy override
17 upload:
18 local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
19 local_filename: overrides-policy.yml
20 remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/
21 node_name: {{ HOSTNAME_CFG01 }}
22
23- description: Create custom cluster control class
24 cmd: echo -e "classes:\n- cluster.{{ LAB_CONFIG_NAME }}.openstack.control_orig\n$(cat /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml)" > /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml
25 node_name: {{ HOSTNAME_CFG01 }}
26
27- description: Rename control classes
28 cmd: mv /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_orig.yml &&
29 ln -s /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml &&
30 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all &&
31 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
32 node_name: {{ HOSTNAME_CFG01 }}
33{%- endif %}
34
35- description: Install glance on all controllers
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@glance:server' state.sls glance -b 1
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
42- description: Install keystone service (note that different fernet keys are created on different nodes)
43 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
44 -C 'I@keystone:server' state.sls keystone.server -b 1
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 2, delay: 15}
47 skip_fail: false
48
49- description: Restart apache due to PROD-10477
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
51 node_name: {{ HOSTNAME_CFG01 }}
52 retry: {count: 1, delay: 15}
53 skip_fail: false
54
55- description: Check apache status to PROD-10477
56 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
57 node_name: {{ HOSTNAME_CFG01 }}
58 retry: {count: 1, delay: 15}
59 skip_fail: false
60
61- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
62 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
63 -C 'I@glance:server' state.sls glusterfs.client
64 node_name: {{ HOSTNAME_CFG01 }}
65 retry: {count: 1, delay: 5}
66 skip_fail: false
67
68- description: Update fernet keys for keystone server on the mounted glusterfs volume
69 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
70 -C 'I@keystone:server' state.sls keystone.server -b 1
71 node_name: {{ HOSTNAME_CFG01 }}
72 retry: {count: 1, delay: 5}
73 skip_fail: false
74
75- description: Populate keystone services/tenants/admins
76 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
77 -C 'I@keystone:client' state.sls keystone.client
78 node_name: {{ HOSTNAME_CFG01 }}
79 retry: {count: 2, delay: 5}
80 skip_fail: false
81
82- description: Check keystone service-list
83 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
84 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 5}
87 skip_fail: false
88
89- description: Check glance image-list
90 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
91 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
92 node_name: {{ HOSTNAME_CFG01 }}
93 retry: {count: 1, delay: 5}
94 skip_fail: false
95
96
97- description: Install nova on all controllers
98 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
99 -C 'I@nova:controller' state.sls nova -b 1
100 node_name: {{ HOSTNAME_CFG01 }}
101 retry: {count: 2, delay: 5}
102 skip_fail: false
103
104- description: Check nova service-list
105 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
106 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
107 node_name: {{ HOSTNAME_CFG01 }}
108 retry: {count: 3, delay: 5}
109 skip_fail: false
110
111
112- description: Install cinder
113 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
114 -C 'I@cinder:controller' state.sls cinder -b 1
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 5}
117 skip_fail: false
118
119- description: Check cinder list
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
121 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 5}
124 skip_fail: false
125
126
127- description: Install neutron service
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
129 -C 'I@neutron:server' state.sls neutron -b 1
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 5}
132 skip_fail: false
133
134- description: Install neutron on gtw node
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
136 -C 'I@neutron:gateway' state.sls neutron
137 node_name: {{ HOSTNAME_CFG01 }}
138 retry: {count: 1, delay: 5}
139 skip_fail: false
140
141# isntall designate
142- description: Install powerdns
143 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
144 -C 'I@powerdns:server' state.sls powerdns.server
145 node_name: {{ HOSTNAME_CFG01 }}
146 retry: {count: 1, delay: 5}
147 skip_fail: false
148
149- description: Install designate
150 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
151 -C 'I@designate:server' state.sls designate -b 1
152 node_name: {{ HOSTNAME_CFG01 }}
153 retry: {count: 5, delay: 10}
154 skip_fail: false
155
156- description: Check neutron agent-list
157 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
158 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 1, delay: 5}
161 skip_fail: false
162
163- description: Install heat service
164 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
165 -C 'I@heat:server' state.sls heat -b 1
166 node_name: {{ HOSTNAME_CFG01 }}
167 retry: {count: 1, delay: 5}
168 skip_fail: false
169
170- description: Check heat service
171 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
172 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
173 node_name: {{ HOSTNAME_CFG01 }}
174 retry: {count: 5, delay: 10}
175 skip_fail: false
176
177
178- description: Deploy horizon dashboard
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
180 -C 'I@horizon:server' state.sls horizon
181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 5}
183 skip_fail: true
184
185- description: Deploy nginx proxy
186 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
187 -C 'I@nginx:server' state.sls nginx
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 1, delay: 5}
190 skip_fail: true
191
192
193# Install compute node
194
195- description: Apply formulas for compute node
196 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 1, delay: 5}
199 skip_fail: true
200
201- description: Re-apply(as in doc) formulas for compute node
202 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
203 node_name: {{ HOSTNAME_CFG01 }}
204 retry: {count: 1, delay: 5}
205 skip_fail: false
206
207- description: Check IP on computes
208 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
209 'ip a'
210 node_name: {{ HOSTNAME_CFG01 }}
211 retry: {count: 10, delay: 30}
212 skip_fail: false
213
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200214- description: Create net04_external
215 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
216 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
217 node_name: {{ HOSTNAME_CFG01 }}
218 retry: {count: 1, delay: 30}
219 skip_fail: false
220
221- description: Create subnet_external
222 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
223 '. /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'
224 node_name: {{ HOSTNAME_CFG01 }}
225 retry: {count: 1, delay: 30}
226 skip_fail: false
227
228- description: Create net04
229 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
230 '. /root/keystonercv3; neutron net-create net04'
231 node_name: {{ HOSTNAME_CFG01 }}
232 retry: {count: 1, delay: 30}
233 skip_fail: false
234
235- description: Create subnet_net04
236 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
237 '. /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'
238 node_name: {{ HOSTNAME_CFG01 }}
239 retry: {count: 1, delay: 30}
240 skip_fail: false
241
242- description: Create router
243 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
244 '. /root/keystonercv3; neutron router-create net04_router01'
245 node_name: {{ HOSTNAME_CFG01 }}
246 retry: {count: 1, delay: 30}
247 skip_fail: false
248
249- description: Set geteway
250 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
251 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
252 node_name: {{ HOSTNAME_CFG01 }}
253 retry: {count: 1, delay: 30}
254 skip_fail: false
255
256- description: Add interface
257 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
258 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
259 node_name: {{ HOSTNAME_CFG01 }}
260 retry: {count: 1, delay: 30}
261 skip_fail: false
262
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200263- description: sync time
264 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
265 'service ntp stop; ntpd -gq; service ntp start'
266 node_name: {{ HOSTNAME_CFG01 }}
267 retry: {count: 1, delay: 30}
268 skip_fail: false
269
270# Configure cinder-volume salt-call PROD-13167
271- description: Set disks 01
272 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
273 node_name: {{ HOSTNAME_CTL01 }}
274 retry: {count: 1, delay: 30}
275 skip_fail: false
276
277- description: Set disks 02
278 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
279 node_name: {{ HOSTNAME_CTL02 }}
280 retry: {count: 1, delay: 30}
281 skip_fail: false
282
283- description: Set disks 03
284 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
285 node_name: {{ HOSTNAME_CTL03 }}
286 retry: {count: 1, delay: 30}
287 skip_fail: false
288
289- description: Create partitions 01
290 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
291 node_name: {{ HOSTNAME_CTL01 }}
292 retry: {count: 1, delay: 30}
293 skip_fail: false
294
295- description: Create partitions 02
296 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
297 node_name: {{ HOSTNAME_CTL02 }}
298 retry: {count: 1, delay: 30}
299 skip_fail: false
300
301- description: Create partitions 03
302 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
303 node_name: {{ HOSTNAME_CTL03 }}
304 retry: {count: 1, delay: 30}
305 skip_fail: false
306
307- description: create volume_group
308 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
309 node_name: {{ HOSTNAME_CFG01 }}
310 retry: {count: 1, delay: 30}
311 skip_fail: false
312
313- description: Install cinder-volume
314 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
315 node_name: {{ HOSTNAME_CFG01 }}
316 retry: {count: 1, delay: 30}
317 skip_fail: false
318
319- description: Install crudini
320 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
321 node_name: {{ HOSTNAME_CFG01 }}
322 retry: {count: 1, delay: 30}
323 skip_fail: false
324
325- description: Temporary WR set enabled backends value 01
326 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
327 node_name: {{ HOSTNAME_CTL01 }}
328 retry: {count: 1, delay: 30}
329 skip_fail: false
330
331- description: Temporary WR set enabled backends value 02
332 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
333 node_name: {{ HOSTNAME_CTL02 }}
334 retry: {count: 1, delay: 30}
335 skip_fail: false
336
337- description: Temporary WR set enabled backends value 03
338 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
339 node_name: {{ HOSTNAME_CTL03 }}
340 retry: {count: 1, delay: 30}
341 skip_fail: false
342
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200343- description: Restart cinder volume
344 cmd: |
345 salt -C 'I@cinder:controller' service.restart cinder-volume;
346 node_name: {{ HOSTNAME_CFG01 }}
347 retry: {count: 2, delay: 5}
348 skip_fail: false
349
Oleksii Butenko5cd0a162018-06-14 18:18:10 +0300350{{ SHARED.INSTALL_DOCKER_ON_GTW() }}
351{{ SHARED.RUN_NEW_TEMPEST() }}