blob: f1e77ea41f2fdedd2503c892f499ddbaf349a1db [file] [log] [blame]
sgudzd7f8ec92018-04-19 16:22:47 +03001{% from 'cookied-bm-mcp-ocata-contrail-nfv/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-bm-mcp-ocata-contrail-nfv/underlay.yaml' import HOSTNAME_GTW01 with context %}
3{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
4{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
5{% set PATTERN = os_env('PATTERN', 'false') %}
6{% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %}
7# Install OpenStack control services
8
9- description: Install glance on all controllers
10 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
11 -C 'I@glance:server' state.sls glance -b 1
12 node_name: {{ HOSTNAME_CFG01 }}
13 retry: {count: 1, delay: 5}
14 skip_fail: false
15
16- description: Install keystone service (note that different fernet keys are created on different nodes)
17 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
18 -C 'I@keystone:server' state.sls keystone.server -b 1
19 node_name: {{ HOSTNAME_CFG01 }}
20 retry: {count: 2, delay: 15}
21 skip_fail: false
22
23- description: Restart apache due to PROD-10477
24 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
25 node_name: {{ HOSTNAME_CFG01 }}
26 retry: {count: 1, delay: 15}
27 skip_fail: false
28
29- description: Check apache status to PROD-10477
30 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 15}
33 skip_fail: false
34
35- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@glance:server' state.sls glusterfs.client
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
42- description: Update fernet keys for keystone server on the mounted glusterfs volume
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: 1, delay: 5}
47 skip_fail: false
48
49- description: Populate keystone services/tenants/admins
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51 -C 'I@keystone:client' state.sls keystone.client
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 2, delay: 5}
54 skip_fail: false
55
56- description: Check keystone service-list
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: false
62
63- description: Check glance image-list
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
65 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: false
69
70- description: Install nova on all controllers
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
72 -C 'I@nova:controller' state.sls nova -b 1
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 2, delay: 5}
75 skip_fail: false
76
77- description: Check nova service-list
78 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
79 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
80 node_name: {{ HOSTNAME_CFG01 }}
81 retry: {count: 3, delay: 5}
82 skip_fail: false
83
84- description: Install cinder
85 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
86 -C 'I@cinder:controller' state.sls cinder -b 1
87 node_name: {{ HOSTNAME_CFG01 }}
88 retry: {count: 1, delay: 5}
89 skip_fail: false
90
91- description: Install cinder volume
92 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
93 -C 'I@cinder:volume' state.sls cinder
94 node_name: {{ HOSTNAME_CFG01 }}
sgudz24ec1182018-08-10 12:50:12 +030095 retry: {count: 2, delay: 10}
sgudzd7f8ec92018-04-19 16:22:47 +030096 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/keystonerc; cinder list'
101 node_name: {{ HOSTNAME_CFG01 }}
102 retry: {count: 1, delay: 5}
103 skip_fail: false
104
105- description: Install neutron service
106 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
107 -C 'I@neutron:server' state.sls neutron -b 1
108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 1, delay: 5}
110 skip_fail: true
111
112# install contrail
113- description: Install Opencontrail db on ctl01
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
115 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 2, delay: 20}
118 skip_fail: false
119
120- description: Install Opencontrail db on all nodes
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
122 -C 'I@opencontrail:database' state.sls opencontrail.database
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 2, delay: 20}
125 skip_fail: false
126
127- description: Install Opencontrail control on ctl01
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
129 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 5}
132 skip_fail: false
133
134- description: Install Opencontrail control on all nodes
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
136 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
137 node_name: {{ HOSTNAME_CFG01 }}
138 retry: {count: 1, delay: 5}
139 skip_fail: false
140
141- description: Install Opencontrail on collector
142 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
143 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 5}
146 skip_fail: false
147
148- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
149 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
150 -C 'I@opencontrail:control' service.restart 'keepalived'
151 node_name: {{ HOSTNAME_CFG01 }}
152 retry: {count: 1, delay: 5}
153 skip_fail: false
154
155# OpenContrail vrouters
156- description: Install Opencontrail client
157 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
158 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 1, delay: 5}
161 skip_fail: false
162
163- description: Install Opencontrail client on computes
164 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
165 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
166 node_name: {{ HOSTNAME_CFG01 }}
167 retry: {count: 2, delay: 5}
168 skip_fail: false
169
170# The next four steps should be converted to one (state.sls opencontrail) with skip_fail: false
171# It is related to bug with hugepages. So we need to add WR, then reboot
172# for only 1G hugepages were mounted. Then re-apply state
173- description: Install Opencontrail on computes
174 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
175 -C 'I@opencontrail:compute' state.sls 'opencontrail'
176 node_name: {{ HOSTNAME_CFG01 }}
177 retry: {count: 1, delay: 5}
178 skip_fail: true
179
180- description: Hack vrouter (Delete default moun point)
181 cmd: salt "cmp*" cmd.run "sed -i 's/exit 0//g' /etc/rc.local; echo 'umount /dev/hugepages; service supervisor-vrouter restart' >> /etc/rc.local; echo 'exit 0' >> /etc/rc.local"
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 1, delay: 30}
184 skip_fail: true
185
186- description: Reboot computes
187 cmd: salt --timeout=600 "cmp*" system.reboot
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 1, delay: 30}
190 skip_fail: true
191
192- description: Install Opencontrail on computes
193 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
194 -C 'I@opencontrail:compute' state.sls 'opencontrail'
195 node_name: {{ HOSTNAME_CFG01 }}
196 retry: {count: 2, delay: 5}
197 skip_fail: false
198
199- description: Remove crashes files from /var/crashes/ while vrouter was crashed
200 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
201 node_name: {{ HOSTNAME_CFG01 }}
202 retry: {count: 1, delay: 30}
203 skip_fail: true
204
205- description: Test Opencontrail
206 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
207 -C 'I@opencontrail:control' cmd.run 'contrail-status'
208 node_name: {{ HOSTNAME_CFG01 }}
209 retry: {count: 1, delay: 5}
210 skip_fail: false
211
212- description: Install heat service
213 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
214 -C 'I@heat:server' state.sls heat -b 1
215 node_name: {{ HOSTNAME_CFG01 }}
216 retry: {count: 1, delay: 5}
217 skip_fail: false
218
219- description: Check heat service
220 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
221 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
222 node_name: {{ HOSTNAME_CFG01 }}
223 retry: {count: 5, delay: 10}
224 skip_fail: false
225
226- description: Deploy horizon dashboard
227 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
228 -C 'I@horizon:server' state.sls horizon
229 node_name: {{ HOSTNAME_CFG01 }}
230 retry: {count: 1, delay: 5}
231 skip_fail: true
232
233- description: Deploy nginx proxy
234 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
235 -C 'I@nginx:server' state.sls nginx
236 node_name: {{ HOSTNAME_CFG01 }}
237 retry: {count: 1, delay: 5}
238 skip_fail: true
239
240# Install compute node
241- description: Apply formulas for compute node
242 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
243 node_name: {{ HOSTNAME_CFG01 }}
244 retry: {count: 1, delay: 5}
245 skip_fail: true
246
247- description: Re-apply(as in doc) formulas for compute node
248 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
249 node_name: {{ HOSTNAME_CFG01 }}
250 retry: {count: 1, delay: 5}
251 skip_fail: false
252
253- description: Check IP on computes
254 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
255 'ip a'
256 node_name: {{ HOSTNAME_CFG01 }}
257 retry: {count: 10, delay: 30}
258 skip_fail: false
259
260 # Upload cirros image
261- description: Upload cirros image on ctl01
262 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
263 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
264 node_name: {{ HOSTNAME_CFG01 }}
265 retry: {count: 2, delay: 30}
266 skip_fail: false
267
268- description: Register image in glance
269 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
270 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img'
271 node_name: {{ HOSTNAME_CFG01 }}
272 retry: {count: 1, delay: 30}
273 skip_fail: false
274
275- description: sync time
276 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
277 'service ntp stop; ntpd -gq; service ntp start'
278 node_name: {{ HOSTNAME_CFG01 }}
279 retry: {count: 1, delay: 30}
280 skip_fail: false
281
282- description: Install docker.io on ctl
283 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
284 node_name: {{ HOSTNAME_CFG01 }}
285 retry: {count: 1, delay: 30}
286 skip_fail: false
287
288- description: Enable forward policy
289 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
290 node_name: {{ HOSTNAME_CFG01 }}
291 retry: {count: 1, delay: 30}
292 skip_fail: false
293
294- description: Hack resolv.conf on VCP nodes for internal services access
295 cmd: |
296 salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 172.18.208.44' > /etc/resolv.conf;"
297 node_name: {{ HOSTNAME_CFG01 }}
298 retry: {count: 1, delay: 5}
299 skip_fail: false
300
301- description: Reboot computes
sgudz2b3dcfa2018-07-18 21:51:38 +0300302 cmd: |
303 salt "cmp*" system.reboot;
304 sleep 600;
sgudzd7f8ec92018-04-19 16:22:47 +0300305 node_name: {{ HOSTNAME_CFG01 }}
306 retry: {count: 1, delay: 30}
307 skip_fail: true