blob: 8675650f93af163a467dcb468766f3d4fb736eff [file] [log] [blame]
abaraniuk68c7f7c2018-08-06 16:06:29 +03001{% from 'cookied-bm-contrail40-nfv/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-bm-contrail40-nfv/underlay.yaml' import HOSTNAME_GTW01 with context %}
3{% from 'cookied-bm-contrail40-nfv/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
145- description: Check contrail status
146 cmd: sleep 15; salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status'
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: false
151
152- description: Install Opencontrail client on computes
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@opencontrail:compute' state.highstate exclude=opencontrail.client
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 2, delay: 5}
157 skip_fail: false
158
159- description: Install heat service
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
161 -C 'I@heat:server' state.sls heat -b 1
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 1, delay: 5}
164 skip_fail: false
165
166- description: Check heat service
167 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
168 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 5, delay: 10}
171 skip_fail: false
172
173- description: Deploy horizon dashboard
174 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
175 -C 'I@horizon:server' state.sls horizon
176 node_name: {{ HOSTNAME_CFG01 }}
177 retry: {count: 1, delay: 5}
178 skip_fail: true
179
180- description: Deploy nginx proxy
181 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
182 -C 'I@nginx:server' state.sls nginx
183 node_name: {{ HOSTNAME_CFG01 }}
184 retry: {count: 1, delay: 5}
185 skip_fail: true
186
187
188# Install compute node
189
190- description: Apply formulas for compute node
191 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
192 node_name: {{ HOSTNAME_CFG01 }}
193 retry: {count: 1, delay: 5}
194 skip_fail: true
195
196- description: Check IP on computes
197 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
198 'ip a'
199 node_name: {{ HOSTNAME_CFG01 }}
200 retry: {count: 10, delay: 30}
201 skip_fail: false
202
203
204 # Upload cirros image
205
206- description: Upload cirros image on ctl01
207 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
208 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
209 node_name: {{ HOSTNAME_CFG01 }}
210 retry: {count: 2, delay: 30}
211 skip_fail: false
212
213- description: Register image in glance
214 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
215 '. /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'
216 node_name: {{ HOSTNAME_CFG01 }}
217 retry: {count: 1, delay: 30}
218 skip_fail: false
219
220- description: Create net04
221 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
222 '. /root/keystonercv3; neutron net-create net04'
223 node_name: {{ HOSTNAME_CFG01 }}
224 retry: {count: 1, delay: 30}
225 skip_fail: false
226
227- description: Create subnet_net04
228 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
229 '. /root/keystonercv3; neutron subnet-create net04 192.168.0.0/24 --name net04__subnet'
230 node_name: {{ HOSTNAME_CFG01 }}
231 retry: {count: 1, delay: 30}
232 skip_fail: false
233
234- description: Create router
235 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
236 '. /root/keystonercv3; neutron router-create net04_router01'
237 node_name: {{ HOSTNAME_CFG01 }}
238 retry: {count: 1, delay: 30}
239 skip_fail: false
240
241- description: Add interface
242 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
243 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
244 node_name: {{ HOSTNAME_CFG01 }}
245 retry: {count: 1, delay: 30}
246 skip_fail: false
247
248- description: Allow all
249 cmd: |
250 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --egress --protocol tcp';
251 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --ingress --protocol tcp';
252 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --egress --protocol icmp';
253 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --ingress --protocol icmp';
254 node_name: {{ HOSTNAME_CFG01 }}
255 retry: {count: 1, delay: 30}
256 skip_fail: true
257
258- description: sync time
259 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
260 'service ntp stop; ntpd -gq; service ntp start'
261 node_name: {{ HOSTNAME_CFG01 }}
262 retry: {count: 1, delay: 30}
263 skip_fail: false
264
265- description: Install docker.io on ctl
266 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
267 node_name: {{ HOSTNAME_CFG01 }}
268 retry: {count: 1, delay: 30}
269 skip_fail: false
270
271- description: Enable forward policy
272 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
273 node_name: {{ HOSTNAME_CFG01 }}
274 retry: {count: 1, delay: 30}
275 skip_fail: false
276
277- description: Hack resolv.conf on VCP nodes for internal services access
278 cmd: |
279 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;"
280 node_name: {{ HOSTNAME_CFG01 }}
281 retry: {count: 1, delay: 5}
282 skip_fail: false
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: |
292 salt "cmp*" system.reboot;
293 sleep 600;
294 node_name: {{ HOSTNAME_CFG01 }}
295 retry: {count: 1, delay: 30}
296 skip_fail: true
297
298- description: Finalize contrail
299 cmd: salt -C 'I@opencontrail:compute' state.sls opencontrail.client
300 node_name: {{ HOSTNAME_CFG01 }}
301 retry: {count: 1, delay: 30}
302 skip_fail: false
303
304- description: Check status for contrail services
305 cmd: |
306 sleep 15;
307 salt -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status'
308 node_name: {{ HOSTNAME_CFG01 }}
309 retry: {count: 1, delay: 30}
310 skip_fail: false
311
312- description: WR for having ability to use hostnames
313 cmd: |
314 CTL01_ADDRESS=`salt --out=newline_values_only 'ctl01*' network.interface_ip ens2`;
315 echo "$CTL01_ADDRESS ctl01.{{ DOMAIN_NAME }} ctl01" >> /etc/hosts;
316 node_name: {{ HOSTNAME_CFG01 }}
317 retry: {count: 1, delay: 30}
318 skip_fail: true