blob: 742a607a3a30363a5fdb9ae1086d16b5f263590b [file] [log] [blame]
sgudz8c888ec2017-10-02 15:29:23 +03001{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
sgudz8c888ec2017-10-02 15:29:23 +03002{% from 'cookied-bm-mcp-ocata-contrail/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 %}
sgudzcced67d2017-10-11 15:56:09 +03005{% set PATTERN = os_env('PATTERN', 'false') %}
6{% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %}
sgudz8c888ec2017-10-02 15:29:23 +03007# 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 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020053 retry: {count: 2, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +030054 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
71- description: Install nova on all controllers
72 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
73 -C 'I@nova:controller' state.sls nova -b 1
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 2, delay: 5}
76 skip_fail: false
77
78- description: Check nova service-list
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
80 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 3, delay: 5}
83 skip_fail: false
84
85
86- description: Install cinder
87 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
88 -C 'I@cinder:controller' state.sls cinder -b 1
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 1, delay: 5}
91 skip_fail: false
92
sgudzcced67d2017-10-11 15:56:09 +030093- description: Install cinder volume
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
95 -C 'I@cinder:volume' state.sls cinder
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 1, delay: 5}
98 skip_fail: false
99
sgudz8c888ec2017-10-02 15:29:23 +0300100- description: Check cinder list
101 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
102 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107
108- description: Install neutron service
109 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
110 -C 'I@neutron:server' state.sls neutron -b 1
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 5}
113 skip_fail: true
114
115# install contrail
sgudz868f0862018-03-16 21:47:18 +0200116- description: Install Opencontrail db on ctl01
117 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
118 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 2, delay: 20}
121 skip_fail: false
122
123- description: Install Opencontrail db on all nodes
sgudz8c888ec2017-10-02 15:29:23 +0300124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@opencontrail:database' state.sls opencontrail.database
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 2, delay: 20}
128 skip_fail: false
129
sgudz868f0862018-03-16 21:47:18 +0200130- description: Install Opencontrail control on ctl01
sgudz8c888ec2017-10-02 15:29:23 +0300131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
132 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
133 node_name: {{ HOSTNAME_CFG01 }}
sgudzcced67d2017-10-11 15:56:09 +0300134 retry: {count: 1, delay: 5}
135 skip_fail: false
136
sgudz868f0862018-03-16 21:47:18 +0200137- description: Install Opencontrail control on all nodes
138 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz8c888ec2017-10-02 15:29:23 +0300139 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
140 node_name: {{ HOSTNAME_CFG01 }}
sgudz868f0862018-03-16 21:47:18 +0200141 retry: {count: 1, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +0300142 skip_fail: false
143
sgudz868f0862018-03-16 21:47:18 +0200144- description: Install Opencontrail on collector
145 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
146 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
sgudzcced67d2017-10-11 15:56:09 +0300147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 5}
149 skip_fail: false
150
sgudz868f0862018-03-16 21:47:18 +0200151- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
sgudz8c888ec2017-10-02 15:29:23 +0300152 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz868f0862018-03-16 21:47:18 +0200153 -C 'I@opencontrail:control' service.restart 'keepalived'
sgudz8c888ec2017-10-02 15:29:23 +0300154 node_name: {{ HOSTNAME_CFG01 }}
sgudz868f0862018-03-16 21:47:18 +0200155 retry: {count: 1, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +0300156 skip_fail: false
157
sgudz868f0862018-03-16 21:47:18 +0200158# OpenContrail vrouters
159- description: Install Opencontrail client
sgudz8c888ec2017-10-02 15:29:23 +0300160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz868f0862018-03-16 21:47:18 +0200161 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 1, delay: 5}
164 skip_fail: false
165
166- description: Install Opencontrail client on computes
167 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
168 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
sgudz8c888ec2017-10-02 15:29:23 +0300169 node_name: {{ HOSTNAME_CFG01 }}
sgudzcced67d2017-10-11 15:56:09 +0300170 retry: {count: 2, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +0300171 skip_fail: false
172
sgudz868f0862018-03-16 21:47:18 +0200173- 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: 2, delay: 5}
178 skip_fail: false
179
180- description: Test Opencontrail
181 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
182 -C 'I@opencontrail:control' cmd.run 'contrail-status'
sgudz8c888ec2017-10-02 15:29:23 +0300183 node_name: {{ HOSTNAME_CFG01 }}
184 retry: {count: 1, delay: 5}
185 skip_fail: false
186
sgudz8c888ec2017-10-02 15:29:23 +0300187- description: Install heat service
188 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
189 -C 'I@heat:server' state.sls heat -b 1
190 node_name: {{ HOSTNAME_CFG01 }}
191 retry: {count: 1, delay: 5}
192 skip_fail: false
193
194- description: Check heat service
195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
196 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 5, delay: 10}
199 skip_fail: false
200
201
202- description: Deploy horizon dashboard
203 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
204 -C 'I@horizon:server' state.sls horizon
205 node_name: {{ HOSTNAME_CFG01 }}
206 retry: {count: 1, delay: 5}
207 skip_fail: true
208
209- description: Deploy nginx proxy
210 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
211 -C 'I@nginx:server' state.sls nginx
212 node_name: {{ HOSTNAME_CFG01 }}
213 retry: {count: 1, delay: 5}
214 skip_fail: true
215
216
217# Install compute node
218
219- description: Apply formulas for compute node
220 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
221 node_name: {{ HOSTNAME_CFG01 }}
222 retry: {count: 1, delay: 5}
223 skip_fail: true
224
225- description: Re-apply(as in doc) 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}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200229 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300230
231- description: Check IP on computes
232 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
233 'ip a'
234 node_name: {{ HOSTNAME_CFG01 }}
235 retry: {count: 10, delay: 30}
236 skip_fail: false
237
238
239 # Upload cirros image
240
241- description: Upload cirros image on ctl01
242 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
243 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
244 node_name: {{ HOSTNAME_CFG01 }}
245 retry: {count: 2, delay: 30}
246 skip_fail: false
247
248- description: Register image in glance
249 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Dmitry Tyzhnenko30f58042017-11-28 17:00:40 +0200250 '. /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'
sgudz8c888ec2017-10-02 15:29:23 +0300251 node_name: {{ HOSTNAME_CFG01 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false
254
sgudz8c888ec2017-10-02 15:29:23 +0300255- description: sync time
256 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
257 'service ntp stop; ntpd -gq; service ntp start'
258 node_name: {{ HOSTNAME_CFG01 }}
259 retry: {count: 1, delay: 30}
260 skip_fail: false
261
sgudzcced67d2017-10-11 15:56:09 +0300262- description: Install docker.io on ctl
263 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
sgudz8c888ec2017-10-02 15:29:23 +0300264 node_name: {{ HOSTNAME_CFG01 }}
265 retry: {count: 1, delay: 30}
266 skip_fail: false
267
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200268- description: Enable forward policy
269 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
270 node_name: {{ HOSTNAME_CFG01 }}
271 retry: {count: 1, delay: 30}
272 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300273
sgudzcced67d2017-10-11 15:56:09 +0300274- description: Hack resolv.conf on VCP nodes for internal services access
275 cmd: |
276 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;"
sgudzcced67d2017-10-11 15:56:09 +0300277 node_name: {{ HOSTNAME_CFG01 }}
278 retry: {count: 1, delay: 5}
279 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300280
sgudzcced67d2017-10-11 15:56:09 +0300281
282- description: Hack vrouter (Delete default moun point)
283 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"
284 node_name: {{ HOSTNAME_CFG01 }}
285 retry: {count: 1, delay: 30}
286 skip_fail: true
287
288- description: Temporary WR for correct pci in vrouter.conf
289 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"
290 node_name: {{ HOSTNAME_CFG01 }}
291 retry: {count: 1, delay: 30}
292 skip_fail: true
293
294- description: Remove crashes files from /var/crashes/ while vrouter was crashed
295 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
296 node_name: {{ HOSTNAME_CFG01 }}
297 retry: {count: 1, delay: 30}
298 skip_fail: true
299
300- description: Reboot computes
301 cmd: salt --timeout=600 "cmp*" system.reboot
302 node_name: {{ HOSTNAME_CFG01 }}
303 retry: {count: 1, delay: 30}
304 skip_fail: true