blob: b122cfa3c2d100a3750d55caafc59249ba47b983 [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
115- description: Install neutron on gtw node
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
117 -C 'I@neutron:gateway' state.sls neutron
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 5}
120 skip_fail: false
121
122# install designate
123- description: Install bind
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
125 -C 'I@bind:server' state.sls bind
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 1, delay: 5}
128 skip_fail: true
129
130- description: Install designate
131 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
132 -C 'I@designate:server' state.sls designate -b 1
133 node_name: {{ HOSTNAME_CFG01 }}
ibumarskov59867632018-05-21 17:03:24 +0400134 retry: {count: 1, delay: 10}
ibumarskov712a6872018-04-25 09:22:15 +0400135 skip_fail: true
136
137- description: Check neutron agent-list
138 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
139 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
140 node_name: {{ HOSTNAME_CFG01 }}
141 retry: {count: 1, delay: 5}
142 skip_fail: false
143
144
145- description: Install heat service
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
147 -C 'I@heat:server' state.sls heat -b 1
148 node_name: {{ HOSTNAME_CFG01 }}
149 retry: {count: 1, delay: 5}
150 skip_fail: false
151
152- description: Check heat service
153 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
154 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
155 node_name: {{ HOSTNAME_CFG01 }}
156 retry: {count: 5, delay: 10}
157 skip_fail: false
158
159
160- description: Deploy horizon dashboard
161 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
162 -C 'I@horizon:server' state.sls horizon
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 1, delay: 5}
165 skip_fail: true
166
167- description: Deploy nginx proxy
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
169 -C 'I@nginx:server' state.sls nginx
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 1, delay: 5}
172 skip_fail: true
173
174
175# Install compute node
176
177- description: Apply formulas for compute node
178 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
179 node_name: {{ HOSTNAME_CFG01 }}
180 retry: {count: 1, delay: 5}
181 skip_fail: true
182
183- description: Re-apply(as in doc) formulas for compute node
184 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
185 node_name: {{ HOSTNAME_CFG01 }}
186 retry: {count: 1, delay: 5}
187 skip_fail: true
188
189- description: Check IP on computes
190 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
191 'ip a'
192 node_name: {{ HOSTNAME_CFG01 }}
193 retry: {count: 10, delay: 30}
194 skip_fail: false
195
196
197 # Upload cirros image
198
199- description: Upload cirros image on ctl01
200 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
201 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
202 node_name: {{ HOSTNAME_CFG01 }}
203 retry: {count: 2, delay: 30}
204 skip_fail: false
205
206- description: Register image in glance
207 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
208 '. /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'
209 node_name: {{ HOSTNAME_CFG01 }}
210 retry: {count: 1, delay: 30}
211 skip_fail: false
212
213- description: Create net04_external
214 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
215 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
216 node_name: {{ HOSTNAME_CFG01 }}
217 retry: {count: 1, delay: 30}
218 skip_fail: false
219
220- description: Create subnet_external
221 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
222 '. /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'
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 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240'
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: Set geteway
249 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
250 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
251 node_name: {{ HOSTNAME_CFG01 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false
254
255- description: Add interface
256 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
257 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
258 node_name: {{ HOSTNAME_CFG01 }}
259 retry: {count: 1, delay: 30}
260 skip_fail: false
261
262#- description: Allow all tcp
263# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
264# '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
265# node_name: {{ HOSTNAME_CFG01 }}
266# retry: {count: 1, delay: 30}
267# skip_fail: false
268#
269#- description: Allow all icmp
270# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
271# '. /root/keystonercv3; openstack security group rule create --proto icmp default'
272# node_name: {{ HOSTNAME_CFG01 }}
273# retry: {count: 1, delay: 30}
274# skip_fail: false
275
276- description: sync time
277 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
278 'service ntp stop; ntpd -gq; service ntp start'
279 node_name: {{ HOSTNAME_CFG01 }}
280 retry: {count: 1, delay: 30}
281 skip_fail: true
282
283- description: Install docker.io on gtw
284 cmd: salt-call cmd.run 'apt-get install docker.io -y'
285 node_name: {{ HOSTNAME_CFG01 }}
286 retry: {count: 1, delay: 30}
287 skip_fail: false
288
289- description: Enable forward policy on gtw
290 cmd: |
291 set -e;
292 iptables --policy FORWARD ACCEPT;
293 node_name: {{ HOSTNAME_GTW01 }}
294 retry: {count: 1, delay: 30}
295 skip_fail: false
296
297- description: create rc file on cfg
298 cmd: scp ctl01:/root/keystonercv3 /root
299 node_name: {{ HOSTNAME_CFG01 }}
300 retry: {count: 1, delay: 30}
301 skip_fail: false
302
303- description: Copy rc file
304 cmd: scp /root/keystonercv3 gtw01:/root
305 node_name: {{ HOSTNAME_CFG01 }}
306 retry: {count: 1, delay: 30}
307 skip_fail: false