blob: fe3546098408743e26e01a9c3f3e1b9551a08ce7 [file] [log] [blame]
ibumarskovf8ef89b2018-02-06 10:51:54 +04001{% from 'virtual-mcp-sl-os/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-mcp-sl-os/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-mcp-sl-os/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-mcp-sl-os/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-mcp-sl-os/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 }}
55 retry: {count: 1, delay: 5}
56 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/keystonerc; 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/keystonerc; 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: 1, 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/keystonerc; 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
ibumarskova99f73c2018-02-26 13:04:18 +0400117# install designate
118- description: Install bind
119 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
120 -C 'I@bind:server' state.sls bind
121 node_name: {{ HOSTNAME_CFG01 }}
122 retry: {count: 1, delay: 5}
123 skip_fail: false
124
125- description: Install designate
126 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
127 -C 'I@designate:server' state.sls designate -b 1
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 5, delay: 10}
130 skip_fail: false
ibumarskovf8ef89b2018-02-06 10:51:54 +0400131
132- description: Check neutron agent-list
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
134 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 5}
137 skip_fail: false
138
139
140- description: Install heat service
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
142 -C 'I@heat:server' state.sls heat -b 1
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 5}
145 skip_fail: false
146
147- description: Check heat service
148 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
149 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
150 node_name: {{ HOSTNAME_CFG01 }}
151 retry: {count: 5, delay: 10}
152 skip_fail: false
153
154
155- description: Deploy horizon dashboard
156 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
157 -C 'I@horizon:server' state.sls horizon
158 node_name: {{ HOSTNAME_CFG01 }}
159 retry: {count: 1, delay: 5}
160 skip_fail: true
161
162- description: Deploy nginx proxy
163 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
164 -C 'I@nginx:server' state.sls nginx
165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 1, delay: 5}
167 skip_fail: true
168
169
170# Install compute node
171
172- description: Apply formulas for compute node
173 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 1, delay: 5}
176 skip_fail: true
177
178- description: Re-apply(as in doc) formulas for compute node
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
180 node_name: {{ HOSTNAME_CFG01 }}
181 retry: {count: 1, delay: 5}
182 skip_fail: true
183
184- description: Check IP on computes
185 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
186 'ip a'
187 node_name: {{ HOSTNAME_CFG01 }}
188 retry: {count: 10, delay: 30}
189 skip_fail: false
190
191
192 # Upload cirros image
193
194- description: Upload cirros image on ctl01
195 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
196 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
197 node_name: {{ HOSTNAME_CFG01 }}
198 retry: {count: 2, delay: 30}
199 skip_fail: false
200
201- description: Register image in glance
202 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
203 '. /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'
204 node_name: {{ HOSTNAME_CFG01 }}
205 retry: {count: 1, delay: 30}
206 skip_fail: false
207
208- description: Create net04_external
209 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
210 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 1, delay: 30}
213 skip_fail: false
214
215- description: Create subnet_external
216 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
217 '. /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'
218 node_name: {{ HOSTNAME_CFG01 }}
219 retry: {count: 1, delay: 30}
220 skip_fail: false
221
222- description: Create net04
223 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
224 '. /root/keystonercv3; neutron net-create net04'
225 node_name: {{ HOSTNAME_CFG01 }}
226 retry: {count: 1, delay: 30}
227 skip_fail: false
228
229- description: Create subnet_net04
230 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
231 '. /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'
232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 1, delay: 30}
234 skip_fail: false
235
236- description: Create router
237 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
238 '. /root/keystonercv3; neutron router-create net04_router01'
239 node_name: {{ HOSTNAME_CFG01 }}
240 retry: {count: 1, delay: 30}
241 skip_fail: false
242
243- description: Set geteway
244 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
245 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
246 node_name: {{ HOSTNAME_CFG01 }}
247 retry: {count: 1, delay: 30}
248 skip_fail: false
249
250- description: Add interface
251 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
252 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
253 node_name: {{ HOSTNAME_CFG01 }}
254 retry: {count: 1, delay: 30}
255 skip_fail: false
256
257#- description: Allow all tcp
258# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
259# '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
260# node_name: {{ HOSTNAME_CFG01 }}
261# retry: {count: 1, delay: 30}
262# skip_fail: false
263#
264#- description: Allow all icmp
265# cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
266# '. /root/keystonercv3; openstack security group rule create --proto icmp default'
267# node_name: {{ HOSTNAME_CFG01 }}
268# retry: {count: 1, delay: 30}
269# skip_fail: false
270
271- description: sync time
272 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
273 'service ntp stop; ntpd -gq; service ntp start'
274 node_name: {{ HOSTNAME_CFG01 }}
275 retry: {count: 1, delay: 30}
276 skip_fail: true
277
278- description: Install docker.io on gtw
279 cmd: salt-call cmd.run 'apt-get install docker.io -y'
280 node_name: {{ HOSTNAME_GTW01 }}
281 retry: {count: 1, delay: 30}
282 skip_fail: false
283
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200284- description: Enable forward policy on gtw
285 cmd: |
286 set -e;
287 iptables --policy FORWARD ACCEPT;
288 node_name: {{ HOSTNAME_GTW01 }}
289 retry: {count: 1, delay: 30}
290 skip_fail: false
291
ibumarskovf8ef89b2018-02-06 10:51:54 +0400292- description: create rc file on cfg
293 cmd: scp ctl01:/root/keystonercv3 /root
294 node_name: {{ HOSTNAME_CFG01 }}
295 retry: {count: 1, delay: 30}
296 skip_fail: false
297
298- description: Copy rc file
299 cmd: scp /root/keystonercv3 gtw01:/root
300 node_name: {{ HOSTNAME_CFG01 }}
301 retry: {count: 1, delay: 30}
302 skip_fail: false