blob: 471fc68211199a01665437e245cf17a5f55f46c0 [file] [log] [blame]
sgudz850e6072018-06-05 14:46:53 +03001{% from 'cookied-bm-contrail40/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-bm-contrail40/underlay.yaml' import HOSTNAME_GTW01 with context %}
3{% from 'cookied-bm-contrail40/underlay.yaml' import DOMAIN_NAME with context %}
4{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
5{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
6{% set PATTERN = os_env('PATTERN', 'false') %}
7{% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %}
8# Install OpenStack control services
9
10- description: Install glance on all controllers
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
12 -C 'I@glance:server' state.sls glance -b 1
13 node_name: {{ HOSTNAME_CFG01 }}
14 retry: {count: 1, delay: 5}
15 skip_fail: false
16
17- description: Install keystone service (note that different fernet keys are created on different nodes)
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@keystone:server' state.sls keystone.server -b 1
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 2, delay: 15}
22 skip_fail: false
23
24- description: Restart apache due to PROD-10477
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
26 node_name: {{ HOSTNAME_CFG01 }}
27 retry: {count: 1, delay: 15}
28 skip_fail: false
29
30- description: Check apache status to PROD-10477
31 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
32 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 15}
34 skip_fail: false
35
36- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
37 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
38 -C 'I@glance:server' state.sls glusterfs.client
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 5}
41 skip_fail: false
42
43- description: Update fernet keys for keystone server on the mounted glusterfs volume
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@keystone:server' state.sls keystone.server -b 1
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 1, delay: 5}
48 skip_fail: false
49
50- description: Populate keystone services/tenants/admins
51 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
52 -C 'I@keystone:client' state.sls keystone.client
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 2, delay: 5}
55 skip_fail: false
56
57- description: Check keystone service-list
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
59 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
60 node_name: {{ HOSTNAME_CFG01 }}
61 retry: {count: 1, delay: 5}
62 skip_fail: false
63
64- description: Check glance image-list
65 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
66 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
67 node_name: {{ HOSTNAME_CFG01 }}
68 retry: {count: 1, delay: 5}
69 skip_fail: false
70
71
72- description: Install nova on all controllers
73 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
74 -C 'I@nova:controller' state.sls nova -b 1
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 2, delay: 5}
77 skip_fail: false
78
79- description: Check nova service-list
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 3, delay: 5}
84 skip_fail: false
85
86
87- description: Install cinder
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@cinder:controller' state.sls cinder -b 1
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 5}
92 skip_fail: false
93
94- description: Install cinder volume
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@cinder:volume' state.sls cinder
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 2, delay: 5}
99 skip_fail: false
100
101- description: Check cinder list
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 5}
106 skip_fail: false
107
108
109- description: Install neutron service
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@neutron:server' state.sls neutron -b 1
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 5}
114 skip_fail: true
115
116# install contrail
117- description: Install docker for Opencontrail
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
119 -C 'I@opencontrail:database' state.sls docker.host
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 20}
122 skip_fail: false
123
124- description: Install Opencontrail requirements
125 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
126 -C 'I@opencontrail:database' state.sls opencontrail exclude=opencontrail.client
127 node_name: {{ HOSTNAME_CFG01 }}
128 retry: {count: 1, delay: 20}
129 skip_fail: false
130
131- description: Spawn Opencontrail docker images
132 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
133 -C 'I@opencontrail:database' state.sls docker.client && sleep 15;
134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 1, delay: 5}
136 skip_fail: false
137
138- description: Finalize opencontrail services
139 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
140 -C 'I@opencontrail:database and *01*' state.sls opencontrail.client
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 3, delay: 30}
143 skip_fail: true
144
sgudz30da28b2018-08-13 22:35:54 +0300145- description: Highstate analytics
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'nal*' state.sls highstate && sleep 15;
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: true
151
sgudz850e6072018-06-05 14:46:53 +0300152- description: Check contrail status
153 cmd: sleep 15; salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status'
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 5}
157 skip_fail: false
158
159- description: Install Opencontrail client on computes
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
161 -C 'I@opencontrail:compute' state.highstate exclude=opencontrail.client
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 2, delay: 5}
164 skip_fail: false
165
166- description: Install heat service
167 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
168 -C 'I@heat:server' state.sls heat -b 1
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 1, delay: 5}
171 skip_fail: false
172
173- description: Check heat service
174 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
175 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
176 node_name: {{ HOSTNAME_CFG01 }}
177 retry: {count: 5, delay: 10}
178 skip_fail: false
179
180- description: Deploy horizon dashboard
181 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
182 -C 'I@horizon:server' state.sls horizon
183 node_name: {{ HOSTNAME_CFG01 }}
184 retry: {count: 1, delay: 5}
185 skip_fail: true
186
187- description: Deploy nginx proxy
188 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
189 -C 'I@nginx:server' state.sls nginx
190 node_name: {{ HOSTNAME_CFG01 }}
191 retry: {count: 1, delay: 5}
192 skip_fail: true
193
194
195# Install compute node
196
197- description: Apply formulas for compute node
198 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
199 node_name: {{ HOSTNAME_CFG01 }}
200 retry: {count: 1, delay: 5}
201 skip_fail: true
202
203- description: Check IP on computes
204 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
205 'ip a'
206 node_name: {{ HOSTNAME_CFG01 }}
207 retry: {count: 10, delay: 30}
208 skip_fail: false
209
210
211 # Upload cirros image
212
213- description: Upload cirros image on ctl01
214 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
215 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
216 node_name: {{ HOSTNAME_CFG01 }}
217 retry: {count: 2, delay: 30}
218 skip_fail: false
219
220- description: Register image in glance
221 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
222 '. /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'
223 node_name: {{ HOSTNAME_CFG01 }}
224 retry: {count: 1, delay: 30}
225 skip_fail: false
226
227- description: Create net04
228 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
229 '. /root/keystonercv3; neutron net-create net04'
230 node_name: {{ HOSTNAME_CFG01 }}
231 retry: {count: 1, delay: 30}
232 skip_fail: false
233
234- description: Create subnet_net04
235 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
236 '. /root/keystonercv3; neutron subnet-create net04 192.168.0.0/24 --name net04__subnet'
237 node_name: {{ HOSTNAME_CFG01 }}
238 retry: {count: 1, delay: 30}
239 skip_fail: false
240
241- description: Create router
242 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
243 '. /root/keystonercv3; neutron router-create net04_router01'
244 node_name: {{ HOSTNAME_CFG01 }}
245 retry: {count: 1, delay: 30}
246 skip_fail: false
247
248- description: Add interface
249 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
250 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
251 node_name: {{ HOSTNAME_CFG01 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false
254
255- description: Allow all
256 cmd: |
257 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --egress --protocol tcp';
258 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --ingress --protocol tcp';
259 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --egress --protocol icmp';
260 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --ingress --protocol icmp';
261 node_name: {{ HOSTNAME_CFG01 }}
262 retry: {count: 1, delay: 30}
263 skip_fail: true
264
265- description: sync time
266 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
267 'service ntp stop; ntpd -gq; service ntp start'
268 node_name: {{ HOSTNAME_CFG01 }}
269 retry: {count: 1, delay: 30}
270 skip_fail: false
271
272- description: Install docker.io on ctl
273 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
274 node_name: {{ HOSTNAME_CFG01 }}
275 retry: {count: 1, delay: 30}
276 skip_fail: false
277
278- description: Enable forward policy
279 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
280 node_name: {{ HOSTNAME_CFG01 }}
281 retry: {count: 1, delay: 30}
282 skip_fail: false
283
284- description: Hack resolv.conf on VCP nodes for internal services access
285 cmd: |
286 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;"
287 node_name: {{ HOSTNAME_CFG01 }}
288 retry: {count: 1, delay: 5}
289 skip_fail: false
290
291- description: Remove crashes files from /var/crashes/ while vrouter was crashed
292 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
293 node_name: {{ HOSTNAME_CFG01 }}
294 retry: {count: 1, delay: 30}
295 skip_fail: true
296
297- description: Reboot computes
298 cmd: |
299 salt "cmp*" system.reboot;
300 sleep 600;
301 node_name: {{ HOSTNAME_CFG01 }}
302 retry: {count: 1, delay: 30}
303 skip_fail: true
304
305- description: Finalize contrail
306 cmd: salt -C 'I@opencontrail:compute' state.sls opencontrail.client
307 node_name: {{ HOSTNAME_CFG01 }}
308 retry: {count: 1, delay: 30}
309 skip_fail: false
310
311- description: Check status for contrail services
312 cmd: |
313 sleep 15;
314 salt -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status'
315 node_name: {{ HOSTNAME_CFG01 }}
316 retry: {count: 1, delay: 30}
317 skip_fail: false
318
319- description: WR for having ability to use hostnames
320 cmd: |
321 CTL01_ADDRESS=`salt --out=newline_values_only 'ctl01*' network.interface_ip ens2`;
322 echo "$CTL01_ADDRESS ctl01.{{ DOMAIN_NAME }} ctl01" >> /etc/hosts;
323 node_name: {{ HOSTNAME_CFG01 }}
324 retry: {count: 1, delay: 30}
325 skip_fail: true