blob: d10e3082c04bec00ed3bbdae854df6aa8aa31244 [file] [log] [blame]
Tatyana Leontovich3c316a12018-01-31 12:42:22 +02001{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
6{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
7{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
8
9# Install OpenStack control services
10
11- description: Install glance on all controllers
12 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
13 -C 'I@glance:server' state.sls glance -b 1
14 node_name: {{ HOSTNAME_CFG01 }}
15 retry: {count: 1, delay: 5}
16 skip_fail: false
17
18- description: Install keystone service (note that different fernet keys are created on different nodes)
19 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
20 -C 'I@keystone:server' state.sls keystone.server -b 1
21 node_name: {{ HOSTNAME_CFG01 }}
22 retry: {count: 2, delay: 15}
23 skip_fail: false
24
25- description: Restart apache due to PROD-10477
26 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 15}
29 skip_fail: false
30
31- description: Check apache status to PROD-10477
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 15}
35 skip_fail: false
36
37- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
39 -C 'I@glance:server' state.sls glusterfs.client
40 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 1, delay: 5}
42 skip_fail: false
43
44- description: Update fernet keys for keystone server on the mounted glusterfs volume
45 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
46 -C 'I@keystone:server' state.sls keystone.server -b 1
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: false
50
51- description: Populate keystone services/tenants/admins
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
53 -C 'I@keystone:client' state.sls keystone.client
54 node_name: {{ HOSTNAME_CFG01 }}
Dennis Dmitrievf073e6f2018-02-06 23:45:15 +020055 retry: {count: 2, delay: 5}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020056 skip_fail: false
57
58- description: Check keystone service-list
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
60 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 5}
63 skip_fail: false
64
65- description: Check glance image-list
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
67 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; glance image-list'
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: false
71
72
73- description: Install nova on all controllers
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
75 -C 'I@nova:controller' state.sls nova -b 1
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 2, delay: 5}
78 skip_fail: false
79
80- description: Check nova service-list
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; nova --debug service-list'
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 3, delay: 5}
85 skip_fail: false
86
87
88- description: Install cinder
89 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
90 -C 'I@cinder:controller' state.sls cinder -b 1
91 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 2, delay: 5}
93 skip_fail: false
94
95- description: Check cinder list
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
97 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; cinder list'
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 1, delay: 5}
100 skip_fail: false
101
102
103- description: Install neutron service
104 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
105 -C 'I@neutron:server' state.sls neutron -b 1
106 node_name: {{ HOSTNAME_CFG01 }}
107 retry: {count: 1, delay: 5}
108 skip_fail: false
109
110- description: Install neutron on gtw node
111 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
112 -C 'I@neutron:gateway' state.sls neutron
113 node_name: {{ HOSTNAME_CFG01 }}
114 retry: {count: 1, delay: 5}
115 skip_fail: false
116
117- description: Check neutron agent-list
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
119 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list'
120 node_name: {{ HOSTNAME_CFG01 }}
121 retry: {count: 1, delay: 5}
122 skip_fail: false
123
124
125- description: Install heat service
126 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
127 -C 'I@heat:server' state.sls heat -b 1
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 5}
130 skip_fail: false
131
132- description: Check heat service
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
134 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 5, delay: 10}
137 skip_fail: false
138
139
140- description: Deploy horizon dashboard
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
142 -C 'I@horizon:server' state.sls horizon
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 5}
145 skip_fail: true
146
147- description: Deploy nginx proxy
148 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
149 -C 'I@nginx:server' state.sls nginx
150 node_name: {{ HOSTNAME_CFG01 }}
151 retry: {count: 1, delay: 5}
152 skip_fail: true
153
154
155# Install compute node
156
157- description: Apply formulas for compute node
158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 1, delay: 5}
161 skip_fail: true
162
163- description: Re-apply(as in doc) formulas for compute node
164 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 1, delay: 5}
167 skip_fail: true
168
169- description: Check IP on computes
170 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
171 'ip a'
172 node_name: {{ HOSTNAME_CFG01 }}
173 retry: {count: 10, delay: 30}
174 skip_fail: false
175
176
177 # Upload cirros image
178# Configure cinder-volume salt-call
179- description: Set disks 01
180 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
181 node_name: {{ HOSTNAME_CTL01 }}
182 retry: {count: 1, delay: 30}
183 skip_fail: false
184
185- description: Set disks 02
186 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
187 node_name: {{ HOSTNAME_CTL02 }}
188 retry: {count: 1, delay: 30}
189 skip_fail: false
190
191- description: Set disks 03
192 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
193 node_name: {{ HOSTNAME_CTL03 }}
194 retry: {count: 1, delay: 30}
195 skip_fail: false
196
197- description: Create partitions 01
198 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
199 node_name: {{ HOSTNAME_CTL01 }}
200 retry: {count: 1, delay: 30}
201 skip_fail: false
202
203- description: Create partitions 02
204 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
205 node_name: {{ HOSTNAME_CTL02 }}
206 retry: {count: 1, delay: 30}
207 skip_fail: false
208
209- description: Create partitions 03
210 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
211 node_name: {{ HOSTNAME_CTL03 }}
212 retry: {count: 1, delay: 30}
213 skip_fail: false
214
215- description: create volume_group
216 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
217 node_name: {{ HOSTNAME_CFG01 }}
218 retry: {count: 1, delay: 30}
219 skip_fail: false
220
221- description: Install cinder-volume
222 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
223 node_name: {{ HOSTNAME_CFG01 }}
224 retry: {count: 1, delay: 30}
225 skip_fail: false
226
227- description: Install crudini
228 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
229 node_name: {{ HOSTNAME_CFG01 }}
230 retry: {count: 1, delay: 30}
231 skip_fail: false
232
233- description: Temporary WR set enabled backends value 01
234 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
235 node_name: {{ HOSTNAME_CTL01 }}
236 retry: {count: 1, delay: 30}
237 skip_fail: false
238
239- description: Temporary WR set enabled backends value 02
240 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
241 node_name: {{ HOSTNAME_CTL02 }}
242 retry: {count: 1, delay: 30}
243 skip_fail: false
244
245- description: Temporary WR set enabled backends value 03
246 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
247 node_name: {{ HOSTNAME_CTL03 }}
248 retry: {count: 1, delay: 30}
249 skip_fail: false
250
251- description: Restart cinder volume
252 cmd: |
253 salt -C 'I@cinder:controller' service.restart cinder-volume;
254 node_name: {{ HOSTNAME_CFG01 }}
255 retry: {count: 2, delay: 5}
256 skip_fail: false
257
258- description: Upload cirros image on ctl01
259 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
260 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
261 node_name: {{ HOSTNAME_CFG01 }}
262 retry: {count: 2, delay: 30}
263 skip_fail: false
264
265- description: Create net04_external
266 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
267 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
268 node_name: {{ HOSTNAME_CFG01 }}
269 retry: {count: 1, delay: 30}
270 skip_fail: false
271
272- description: Create subnet_external
273 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
274 '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1'
275 node_name: {{ HOSTNAME_CFG01 }}
276 retry: {count: 1, delay: 30}
277 skip_fail: false
278
279- description: Create net04
280 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
281 '. /root/keystonercv3; neutron net-create net04'
282 node_name: {{ HOSTNAME_CFG01 }}
283 retry: {count: 1, delay: 30}
284 skip_fail: false
285
286- description: Create subnet_net04
287 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
288 '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240'
289 node_name: {{ HOSTNAME_CFG01 }}
290 retry: {count: 1, delay: 30}
291 skip_fail: false
292
293- description: Create router
294 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
295 '. /root/keystonercv3; neutron router-create net04_router01'
296 node_name: {{ HOSTNAME_CFG01 }}
297 retry: {count: 1, delay: 30}
298 skip_fail: false
299
300- description: Set geteway
301 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
302 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
303 node_name: {{ HOSTNAME_CFG01 }}
304 retry: {count: 1, delay: 30}
305 skip_fail: false
306
307- description: Add interface
308 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
309 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
310 node_name: {{ HOSTNAME_CFG01 }}
311 retry: {count: 1, delay: 30}
312 skip_fail: false
313
314- description: sync time
315 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
316 'service ntp stop; ntpd -gq; service ntp start'
317 node_name: {{ HOSTNAME_CFG01 }}
318 retry: {count: 1, delay: 30}
319 skip_fail: false
320
321- description: Install docker.io on gtw
322 cmd: salt-call cmd.run 'apt-get install docker.io -y'
323 node_name: {{ HOSTNAME_GTW01 }}
324 retry: {count: 1, delay: 30}
325 skip_fail: false
326
327- description: create rc file on cfg
328 cmd: scp ctl01:/root/keystonercv3 /root
329 node_name: {{ HOSTNAME_CFG01 }}
330 retry: {count: 1, delay: 30}
331 skip_fail: false
332
333- description: Copy rc file
334 cmd: scp /root/keystonercv3 gtw01:/root
335 node_name: {{ HOSTNAME_CFG01 }}
336 retry: {count: 1, delay: 30}
337 skip_fail: false