blob: 1145610510c0ce47e6822d92ea335762b6341dfc [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
16- description: Install glance on all controllers
17 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
18 -C 'I@glance:server' state.sls glance -b 1
19 node_name: {{ HOSTNAME_CFG01 }}
ibumarskov59867632018-05-21 17:03:24 +040020 retry: {count: 1, delay: 5}
ibumarskov712a6872018-04-25 09:22:15 +040021 skip_fail: false
22
23- description: Install keystone service (note that different fernet keys are created on different nodes)
24 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
25 -C 'I@keystone:server' state.sls keystone.server -b 1
26 node_name: {{ HOSTNAME_CFG01 }}
27 retry: {count: 2, delay: 15}
28 skip_fail: false
29
30- description: Restart apache due to PROD-10477
31 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "service apache2 restart"
32 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 15}
34 skip_fail: false
35
36- description: Check apache status to PROD-10477
37 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "service apache2 status"
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 15}
40 skip_fail: false
41
42- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
43 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
44 -C 'I@glance:server' state.sls glusterfs.client
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 1, delay: 5}
47 skip_fail: false
48
49- description: Update fernet keys for keystone server on the mounted glusterfs volume
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51 -C 'I@keystone:server' state.sls keystone.server -b 1
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 1, delay: 5}
54 skip_fail: false
55
56- description: Populate keystone services/tenants/admins
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@keystone:client' state.sls keystone.client
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: false
62
63- description: Check keystone service-list
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
65 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: false
69
70- description: Check glance image-list
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
72 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 5}
75 skip_fail: false
76
77
78- description: Install nova on all controllers
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
80 -C 'I@nova:controller' state.sls nova -b 1
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 2, delay: 5}
83 skip_fail: false
84
85- description: Check nova service-list
86 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
87 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 3, delay: 5}
90 skip_fail: false
91
92
93- description: Install cinder
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
95 -C 'I@cinder:controller' state.sls cinder -b 1
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 1, delay: 5}
98 skip_fail: false
99
100- 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: false
114
ibumarskove6194da2018-07-03 15:02:49 +0400115- description: Workaround for PROD-21105
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
117 -C 'I@neutron:gateway' grains.set noservices True
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 5}
120 skip_fail: false
121
ibumarskov712a6872018-04-25 09:22:15 +0400122- description: Install neutron on gtw node
123 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
124 -C 'I@neutron:gateway' state.sls neutron
125 node_name: {{ HOSTNAME_CFG01 }}
126 retry: {count: 1, delay: 5}
127 skip_fail: false
128
129# install designate
130- description: Install bind
131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
132 -C 'I@bind:server' state.sls bind
133 node_name: {{ HOSTNAME_CFG01 }}
134 retry: {count: 1, delay: 5}
135 skip_fail: true
136
137- description: Install designate
138 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
139 -C 'I@designate:server' state.sls designate -b 1
140 node_name: {{ HOSTNAME_CFG01 }}
ibumarskov59867632018-05-21 17:03:24 +0400141 retry: {count: 1, delay: 10}
ibumarskov712a6872018-04-25 09:22:15 +0400142 skip_fail: true
143
144- description: Check neutron agent-list
145 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
146 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 5}
149 skip_fail: false
150
151
152- description: Install heat service
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@heat:server' state.sls heat -b 1
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 1, delay: 5}
157 skip_fail: false
158
159- description: Check heat service
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
161 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 5, delay: 10}
164 skip_fail: false
165
166
167- description: Deploy horizon dashboard
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
169 -C 'I@horizon:server' state.sls horizon
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 1, delay: 5}
172 skip_fail: true
173
174- description: Deploy nginx proxy
175 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
176 -C 'I@nginx:server' state.sls nginx
177 node_name: {{ HOSTNAME_CFG01 }}
178 retry: {count: 1, delay: 5}
179 skip_fail: true
180
181
182# Install compute node
183
184- description: Apply formulas for compute node
185 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
186 node_name: {{ HOSTNAME_CFG01 }}
187 retry: {count: 1, delay: 5}
188 skip_fail: true
189
190- description: Re-apply(as in doc) 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_external
221 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
222 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
223 node_name: {{ HOSTNAME_CFG01 }}
224 retry: {count: 1, delay: 30}
225 skip_fail: false
226
227- description: Create subnet_external
228 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
229 '. /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'
230 node_name: {{ HOSTNAME_CFG01 }}
231 retry: {count: 1, delay: 30}
232 skip_fail: false
233
234- description: Create net04
235 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
236 '. /root/keystonercv3; neutron net-create net04'
237 node_name: {{ HOSTNAME_CFG01 }}
238 retry: {count: 1, delay: 30}
239 skip_fail: false
240
241- description: Create subnet_net04
242 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
243 '. /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'
244 node_name: {{ HOSTNAME_CFG01 }}
245 retry: {count: 1, delay: 30}
246 skip_fail: false
247
248- description: Create router
249 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
250 '. /root/keystonercv3; neutron router-create net04_router01'
251 node_name: {{ HOSTNAME_CFG01 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false
254
255- description: Set geteway
256 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
257 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
258 node_name: {{ HOSTNAME_CFG01 }}
259 retry: {count: 1, delay: 30}
260 skip_fail: false
261
262- description: Add interface
263 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
264 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
265 node_name: {{ HOSTNAME_CFG01 }}
266 retry: {count: 1, delay: 30}
267 skip_fail: false
268
269#- description: Allow all tcp
270# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
271# '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
272# node_name: {{ HOSTNAME_CFG01 }}
273# retry: {count: 1, delay: 30}
274# skip_fail: false
275#
276#- description: Allow all icmp
277# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
278# '. /root/keystonercv3; openstack security group rule create --proto icmp default'
279# node_name: {{ HOSTNAME_CFG01 }}
280# retry: {count: 1, delay: 30}
281# skip_fail: false
282
283- description: sync time
284 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
285 'service ntp stop; ntpd -gq; service ntp start'
286 node_name: {{ HOSTNAME_CFG01 }}
287 retry: {count: 1, delay: 30}
288 skip_fail: true
289
290- description: Install docker.io on gtw
291 cmd: salt-call cmd.run 'apt-get install docker.io -y'
292 node_name: {{ HOSTNAME_CFG01 }}
293 retry: {count: 1, delay: 30}
294 skip_fail: false
295
296- description: Enable forward policy on gtw
297 cmd: |
298 set -e;
299 iptables --policy FORWARD ACCEPT;
300 node_name: {{ HOSTNAME_GTW01 }}
301 retry: {count: 1, delay: 30}
302 skip_fail: false
303
304- description: create rc file on cfg
305 cmd: scp ctl01:/root/keystonercv3 /root
306 node_name: {{ HOSTNAME_CFG01 }}
307 retry: {count: 1, delay: 30}
308 skip_fail: false
309
310- description: Copy rc file
311 cmd: scp /root/keystonercv3 gtw01:/root
312 node_name: {{ HOSTNAME_CFG01 }}
313 retry: {count: 1, delay: 30}
314 skip_fail: false