blob: ea53986d66d02bc25c814acc1ea805f9d070542b [file] [log] [blame]
ibumarskov712a6872018-04-25 09:22:15 +04001{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-mcp-trusty/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
ibumarskov59867632018-05-21 17:03:24 +040010- description: Sync time
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False -G 'oscodename:trusty' cmd.run "service ntp stop && ntpdate pool.ntp.org && service ntp start"
12 node_name: {{ HOSTNAME_CFG01 }}
13 retry: {count: 1, delay: 5}
14 skip_fail: false
ibumarskov712a6872018-04-25 09:22:15 +040015
ibumarskove23c10e2018-08-20 15:47:58 +040016- description: Install glance on primary controller
ibumarskov712a6872018-04-25 09:22:15 +040017 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskove23c10e2018-08-20 15:47:58 +040018 -C 'I@glance:server:role:primary' state.sls glance -b 1
19 node_name: {{ HOSTNAME_CFG01 }}
20 retry: {count: 1, delay: 5}
21 skip_fail: false
22
23- description: Install glance on other controllers
24 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
25 -C 'I@glance:server:role:secondary' state.sls glance -b 1
ibumarskov712a6872018-04-25 09:22:15 +040026 node_name: {{ HOSTNAME_CFG01 }}
ibumarskov59867632018-05-21 17:03:24 +040027 retry: {count: 1, delay: 5}
ibumarskov712a6872018-04-25 09:22:15 +040028 skip_fail: false
29
30- description: Install keystone service (note that different fernet keys are created on different nodes)
31 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
32 -C 'I@keystone:server' state.sls keystone.server -b 1
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 2, delay: 15}
35 skip_fail: false
36
37- description: Restart apache due to PROD-10477
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "service apache2 restart"
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 15}
41 skip_fail: false
42
43- description: Check apache status to PROD-10477
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "service apache2 status"
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 1, delay: 15}
47 skip_fail: false
48
49- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51 -C 'I@glance:server' state.sls glusterfs.client
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 1, delay: 5}
54 skip_fail: false
55
56- description: Update fernet keys for keystone server on the mounted glusterfs volume
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@keystone:server' state.sls keystone.server -b 1
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: false
62
63- description: Populate keystone services/tenants/admins
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
65 -C 'I@keystone:client' state.sls keystone.client
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: false
69
70- description: Check keystone service-list
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
72 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 5}
75 skip_fail: false
76
77- description: Check glance image-list
78 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
79 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
80 node_name: {{ HOSTNAME_CFG01 }}
81 retry: {count: 1, delay: 5}
82 skip_fail: false
83
84
85- description: Install nova on all controllers
86 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
87 -C 'I@nova:controller' state.sls nova -b 1
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 2, delay: 5}
90 skip_fail: false
91
92- description: Check nova service-list
93 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
94 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
95 node_name: {{ HOSTNAME_CFG01 }}
96 retry: {count: 3, delay: 5}
97 skip_fail: false
98
99
100- description: Install cinder
101 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
102 -C 'I@cinder:controller' state.sls cinder -b 1
103 node_name: {{ HOSTNAME_CFG01 }}
104 retry: {count: 1, delay: 5}
105 skip_fail: false
106
107- description: Check cinder list
108 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
109 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
110 node_name: {{ HOSTNAME_CFG01 }}
111 retry: {count: 1, delay: 5}
112 skip_fail: false
113
114
115- description: Install neutron service
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
117 -C 'I@neutron:server' state.sls neutron -b 1
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 5}
120 skip_fail: false
121
ibumarskove6194da2018-07-03 15:02:49 +0400122- description: Workaround for PROD-21105
123 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
124 -C 'I@neutron:gateway' grains.set noservices True
125 node_name: {{ HOSTNAME_CFG01 }}
126 retry: {count: 1, delay: 5}
127 skip_fail: false
128
ibumarskov712a6872018-04-25 09:22:15 +0400129- description: Install neutron on gtw node
130 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
131 -C 'I@neutron:gateway' state.sls neutron
132 node_name: {{ HOSTNAME_CFG01 }}
133 retry: {count: 1, delay: 5}
134 skip_fail: false
135
136# install designate
137- description: Install bind
138 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
139 -C 'I@bind:server' state.sls bind
140 node_name: {{ HOSTNAME_CFG01 }}
141 retry: {count: 1, delay: 5}
142 skip_fail: true
143
144- description: Install designate
145 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
146 -C 'I@designate:server' state.sls designate -b 1
147 node_name: {{ HOSTNAME_CFG01 }}
ibumarskov59867632018-05-21 17:03:24 +0400148 retry: {count: 1, delay: 10}
ibumarskov712a6872018-04-25 09:22:15 +0400149 skip_fail: true
150
151- description: Check neutron agent-list
152 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
153 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
154 node_name: {{ HOSTNAME_CFG01 }}
155 retry: {count: 1, delay: 5}
156 skip_fail: false
157
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
174- description: Deploy horizon dashboard
175 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
176 -C 'I@horizon:server' state.sls horizon
177 node_name: {{ HOSTNAME_CFG01 }}
178 retry: {count: 1, delay: 5}
179 skip_fail: true
180
181- description: Deploy nginx proxy
182 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
183 -C 'I@nginx:server' state.sls nginx
184 node_name: {{ HOSTNAME_CFG01 }}
185 retry: {count: 1, delay: 5}
186 skip_fail: true
187
188
189# Install compute node
190
191- description: Apply formulas for compute node
192 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
193 node_name: {{ HOSTNAME_CFG01 }}
194 retry: {count: 1, delay: 5}
195 skip_fail: true
196
197- description: Re-apply(as in doc) 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_external
228 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
229 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
230 node_name: {{ HOSTNAME_CFG01 }}
231 retry: {count: 1, delay: 30}
232 skip_fail: false
233
234- description: Create subnet_external
235 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
236 '. /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'
237 node_name: {{ HOSTNAME_CFG01 }}
238 retry: {count: 1, delay: 30}
239 skip_fail: false
240
241- description: Create net04
242 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
243 '. /root/keystonercv3; neutron net-create net04'
244 node_name: {{ HOSTNAME_CFG01 }}
245 retry: {count: 1, delay: 30}
246 skip_fail: false
247
248- description: Create subnet_net04
249 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
250 '. /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'
251 node_name: {{ HOSTNAME_CFG01 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false
254
255- description: Create router
256 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
257 '. /root/keystonercv3; neutron router-create net04_router01'
258 node_name: {{ HOSTNAME_CFG01 }}
259 retry: {count: 1, delay: 30}
260 skip_fail: false
261
262- description: Set geteway
263 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
264 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
265 node_name: {{ HOSTNAME_CFG01 }}
266 retry: {count: 1, delay: 30}
267 skip_fail: false
268
269- description: Add interface
270 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
271 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
272 node_name: {{ HOSTNAME_CFG01 }}
273 retry: {count: 1, delay: 30}
274 skip_fail: false
275
276#- description: Allow all tcp
277# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
278# '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
279# node_name: {{ HOSTNAME_CFG01 }}
280# retry: {count: 1, delay: 30}
281# skip_fail: false
282#
283#- description: Allow all icmp
284# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
285# '. /root/keystonercv3; openstack security group rule create --proto icmp default'
286# node_name: {{ HOSTNAME_CFG01 }}
287# retry: {count: 1, delay: 30}
288# skip_fail: false
289
290- description: sync time
291 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
292 'service ntp stop; ntpd -gq; service ntp start'
293 node_name: {{ HOSTNAME_CFG01 }}
294 retry: {count: 1, delay: 30}
295 skip_fail: true
296
297- description: Install docker.io on gtw
298 cmd: salt-call cmd.run 'apt-get install docker.io -y'
299 node_name: {{ HOSTNAME_CFG01 }}
300 retry: {count: 1, delay: 30}
301 skip_fail: false
302
303- description: Enable forward policy on gtw
304 cmd: |
305 set -e;
306 iptables --policy FORWARD ACCEPT;
307 node_name: {{ HOSTNAME_GTW01 }}
308 retry: {count: 1, delay: 30}
309 skip_fail: false
310
311- description: create rc file on cfg
312 cmd: scp ctl01:/root/keystonercv3 /root
313 node_name: {{ HOSTNAME_CFG01 }}
314 retry: {count: 1, delay: 30}
315 skip_fail: false
316
317- description: Copy rc file
318 cmd: scp /root/keystonercv3 gtw01:/root
319 node_name: {{ HOSTNAME_CFG01 }}
320 retry: {count: 1, delay: 30}
321 skip_fail: false