blob: 0fed1c0f0687d851042f8d0bd2b1c6757a05f834 [file] [log] [blame]
sgudzf5a51222018-05-11 14:20:50 +03001{% from 'cookied-bm-contrail-maas/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-bm-contrail-maas/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# Install OpenStack control services
6
7- description: Install glance on all controllers
8 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
9 -C 'I@glance:server' state.sls glance -b 1
10 node_name: {{ HOSTNAME_CFG01 }}
11 retry: {count: 1, delay: 5}
12 skip_fail: false
13
14- description: Install keystone service (note that different fernet keys are created on different nodes)
15 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
16 -C 'I@keystone:server' state.sls keystone.server -b 1
17 node_name: {{ HOSTNAME_CFG01 }}
18 retry: {count: 2, delay: 15}
19 skip_fail: false
20
21- description: Restart apache due to PROD-10477
22 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
23 node_name: {{ HOSTNAME_CFG01 }}
24 retry: {count: 1, delay: 15}
25 skip_fail: false
26
27- description: Check apache status to PROD-10477
28 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
29 node_name: {{ HOSTNAME_CFG01 }}
30 retry: {count: 1, delay: 15}
31 skip_fail: false
32
33- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
34 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
35 -C 'I@glance:server' state.sls glusterfs.client
36 node_name: {{ HOSTNAME_CFG01 }}
37 retry: {count: 1, delay: 5}
38 skip_fail: false
39
40- description: Update fernet keys for keystone server on the mounted glusterfs volume
41 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
42 -C 'I@keystone:server' state.sls keystone.server -b 1
43 node_name: {{ HOSTNAME_CFG01 }}
44 retry: {count: 1, delay: 5}
45 skip_fail: false
46
47- description: Populate keystone services/tenants/admins
48 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
49 -C 'I@keystone:client' state.sls keystone.client
50 node_name: {{ HOSTNAME_CFG01 }}
51 retry: {count: 2, delay: 5}
52 skip_fail: false
53
54- description: Check keystone service-list
55 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
56 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
57 node_name: {{ HOSTNAME_CFG01 }}
58 retry: {count: 1, delay: 5}
59 skip_fail: false
60
61- description: Check glance image-list
62 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
63 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
64 node_name: {{ HOSTNAME_CFG01 }}
65 retry: {count: 1, delay: 5}
66 skip_fail: false
67
68
69- description: Install nova on all controllers
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
71 -C 'I@nova:controller' state.sls nova -b 1
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 2, delay: 5}
74 skip_fail: false
75
76- description: Check nova service-list
77 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
78 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
79 node_name: {{ HOSTNAME_CFG01 }}
80 retry: {count: 3, delay: 5}
81 skip_fail: false
82
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 }}
95 retry: {count: 1, 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/keystonerc; 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: true
112
113# install contrail
114- description: Install Opencontrail db on ctl01
115 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
116 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
117 node_name: {{ HOSTNAME_CFG01 }}
118 retry: {count: 2, delay: 20}
119 skip_fail: false
120
121- description: Install Opencontrail db on all nodes
122 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
123 -C 'I@opencontrail:database' state.sls opencontrail.database
124 node_name: {{ HOSTNAME_CFG01 }}
125 retry: {count: 2, delay: 20}
126 skip_fail: false
127
128- description: Install Opencontrail control on ctl01
129 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
130 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
131 node_name: {{ HOSTNAME_CFG01 }}
132 retry: {count: 1, delay: 5}
133 skip_fail: false
134
135- description: Install Opencontrail control on all nodes
136 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
137 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
138 node_name: {{ HOSTNAME_CFG01 }}
139 retry: {count: 1, delay: 5}
140 skip_fail: false
141
142- description: Install Opencontrail on collector
143 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
144 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
145 node_name: {{ HOSTNAME_CFG01 }}
146 retry: {count: 1, delay: 5}
147 skip_fail: false
148
149- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
150 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
151 -C 'I@opencontrail:control' service.restart 'keepalived'
152 node_name: {{ HOSTNAME_CFG01 }}
153 retry: {count: 1, delay: 5}
154 skip_fail: false
155
156# OpenContrail vrouters
157- description: Install Opencontrail client
158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
159 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
160 node_name: {{ HOSTNAME_CFG01 }}
161 retry: {count: 1, delay: 5}
162 skip_fail: false
163
164- description: Install Opencontrail client on computes
165 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
166 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
167 node_name: {{ HOSTNAME_CFG01 }}
168 retry: {count: 2, delay: 5}
169 skip_fail: false
170
171- description: Install Opencontrail on computes
172 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
173 -C 'I@opencontrail:compute' state.sls 'opencontrail'
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 2, delay: 5}
176 skip_fail: false
177
178- description: Test Opencontrail
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
180 -C 'I@opencontrail:control' cmd.run 'contrail-status'
181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 5}
183 skip_fail: false
184
185- description: Install heat service
186 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
187 -C 'I@heat:server' state.sls heat -b 1
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 1, delay: 5}
190 skip_fail: false
191
192- description: Check heat service
193 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
194 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
195 node_name: {{ HOSTNAME_CFG01 }}
196 retry: {count: 5, delay: 10}
197 skip_fail: false
198
199
200- description: Deploy horizon dashboard
201 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
202 -C 'I@horizon:server' state.sls horizon
203 node_name: {{ HOSTNAME_CFG01 }}
204 retry: {count: 1, delay: 5}
205 skip_fail: true
206
207- description: Deploy nginx proxy
208 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
209 -C 'I@nginx:server' state.sls nginx
210 node_name: {{ HOSTNAME_CFG01 }}
211 retry: {count: 1, delay: 5}
212 skip_fail: true
213
214
215# Install compute node
216
217- description: Apply formulas for compute node
218 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
219 node_name: {{ HOSTNAME_CFG01 }}
220 retry: {count: 1, delay: 5}
221 skip_fail: true
222
223- description: Re-apply(as in doc) formulas for compute node
224 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
225 node_name: {{ HOSTNAME_CFG01 }}
226 retry: {count: 1, delay: 5}
227 skip_fail: false
228
229- description: Check IP on computes
230 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
231 'ip a'
232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 10, delay: 30}
234 skip_fail: false
235
236
237 # Upload cirros image
238
239- description: Upload cirros image on ctl01
240 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
241 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
242 node_name: {{ HOSTNAME_CFG01 }}
243 retry: {count: 2, delay: 30}
244 skip_fail: false
245
246- description: Register image in glance
247 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
248 '. /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'
249 node_name: {{ HOSTNAME_CFG01 }}
250 retry: {count: 1, delay: 30}
251 skip_fail: false
252
253- description: sync time
254 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
255 'service ntp stop; ntpd -gq; service ntp start'
256 node_name: {{ HOSTNAME_CFG01 }}
257 retry: {count: 1, delay: 30}
258 skip_fail: false
259
260- description: Install docker.io on ctl
261 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
262 node_name: {{ HOSTNAME_CFG01 }}
263 retry: {count: 1, delay: 30}
264 skip_fail: false
265
266- description: Enable forward policy
267 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
268 node_name: {{ HOSTNAME_CFG01 }}
269 retry: {count: 1, delay: 30}
270 skip_fail: false
271
272- description: Hack vrouter (Delete default moun point)
273 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"
274 node_name: {{ HOSTNAME_CFG01 }}
275 retry: {count: 1, delay: 30}
276 skip_fail: true
277
278- description: Temporary WR for correct pci in vrouter.conf
279 cmd: salt "cmp*" cmd.run "sed -i 's/physical\_interface\_address\=.*/physical\_interface\_address=0000\:05\:00\.0/g' /etc/contrail/contrail-vrouter-agent.conf"
280 node_name: {{ HOSTNAME_CFG01 }}
281 retry: {count: 1, delay: 30}
282 skip_fail: true
283
284- description: Remove crashes files from /var/crashes/ while vrouter was crashed
285 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
286 node_name: {{ HOSTNAME_CFG01 }}
287 retry: {count: 1, delay: 30}
288 skip_fail: true
289
290- description: Reboot computes
291 cmd: salt --timeout=600 "cmp*" system.reboot
292 node_name: {{ HOSTNAME_CFG01 }}
293 retry: {count: 1, delay: 30}
294 skip_fail: true