blob: b2bbba84940e88ffe63e9e2ec14e67587407d028 [file] [log] [blame]
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +02001{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'cookied-mcp-pike-dvr/underlay.yaml' import HOSTNAME_GTW01 with context %}
Oleksii Butenko2e8e8ee2018-06-21 11:10:13 +03006{% from 'cookied-mcp-pike-dvr/underlay.yaml' import LAB_CONFIG_NAME with context %}
7{% from 'cookied-mcp-pike-dvr/underlay.yaml' import DOMAIN_NAME with context %}
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +02008{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
9{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
10{% set LAB_CONFIG_NAME = os_env('LAB_CONFIG_NAME') %}
11{% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %}
12
Oleksii Butenko5cd0a162018-06-14 18:18:10 +030013{% import 'shared-salt.yaml' as SHARED with context %}
14
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +020015# Install OpenStack control services
16
17{%- if OVERRIDE_POLICY != '' %}
18- description: Upload policy override
19 upload:
20 local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/
21 local_filename: overrides-policy.yml
22 remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/
23 node_name: {{ HOSTNAME_CFG01 }}
24
25- description: Create custom cluster control class
26 cmd: echo -e "classes:\n- cluster.{{ LAB_CONFIG_NAME }}.openstack.control_orig\n$(cat /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml)" > /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml
27 node_name: {{ HOSTNAME_CFG01 }}
28
29- description: Rename control classes
30 cmd: mv /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_orig.yml &&
31 ln -s /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml &&
32 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all &&
33 salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
34 node_name: {{ HOSTNAME_CFG01 }}
35{%- endif %}
36
37- description: Install glance on all controllers
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
39 -C 'I@glance:server' state.sls glance -b 1
40 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 1, delay: 5}
42 skip_fail: false
43
44- description: Install keystone service (note that different fernet keys are created on different nodes)
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: 2, delay: 15}
49 skip_fail: false
50
51- description: Restart apache due to PROD-10477
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2"
53 node_name: {{ HOSTNAME_CFG01 }}
54 retry: {count: 1, delay: 15}
55 skip_fail: false
56
57- description: Check apache status to PROD-10477
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2"
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 15}
61 skip_fail: false
62
63- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
65 -C 'I@glance:server' state.sls glusterfs.client
66 node_name: {{ HOSTNAME_CFG01 }}
67 retry: {count: 1, delay: 5}
68 skip_fail: false
69
70- description: Update fernet keys for keystone server on the mounted glusterfs volume
71 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
72 -C 'I@keystone:server' state.sls keystone.server -b 1
73 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 5}
75 skip_fail: false
76
77- description: Populate keystone services/tenants/admins
78 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
79 -C 'I@keystone:client' state.sls keystone.client
80 node_name: {{ HOSTNAME_CFG01 }}
81 retry: {count: 2, delay: 5}
82 skip_fail: false
83
84- description: Check keystone service-list
85 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
86 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list'
87 node_name: {{ HOSTNAME_CFG01 }}
88 retry: {count: 1, delay: 5}
89 skip_fail: false
90
91- description: Check glance image-list
92 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
93 -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
94 node_name: {{ HOSTNAME_CFG01 }}
95 retry: {count: 1, delay: 5}
96 skip_fail: false
97
98
99- description: Install nova on all controllers
100 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
101 -C 'I@nova:controller' state.sls nova -b 1
102 node_name: {{ HOSTNAME_CFG01 }}
103 retry: {count: 2, delay: 5}
104 skip_fail: false
105
106- description: Check nova service-list
107 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
108 -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list'
109 node_name: {{ HOSTNAME_CFG01 }}
110 retry: {count: 3, delay: 5}
111 skip_fail: false
112
113
114- description: Install cinder
115 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
116 -C 'I@cinder:controller' state.sls cinder -b 1
117 node_name: {{ HOSTNAME_CFG01 }}
118 retry: {count: 1, delay: 5}
119 skip_fail: false
120
121- description: Check cinder list
122 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
123 -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
124 node_name: {{ HOSTNAME_CFG01 }}
125 retry: {count: 1, delay: 5}
126 skip_fail: false
127
128
129- description: Install neutron service
130 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
131 -C 'I@neutron:server' state.sls neutron -b 1
132 node_name: {{ HOSTNAME_CFG01 }}
133 retry: {count: 1, delay: 5}
134 skip_fail: false
135
136- description: Install neutron on gtw node
137 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
138 -C 'I@neutron:gateway' state.sls neutron
139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 1, delay: 5}
141 skip_fail: false
142
143# isntall designate
obutenko830e6f62018-07-03 16:37:13 +0300144#- description: Install powerdns
145# cmd: salt --hard-crash --state-output=mixed --state-verbose=False
146# -C 'I@powerdns:server' state.sls powerdns.server
147# node_name: {{ HOSTNAME_CFG01 }}
148# retry: {count: 1, delay: 5}
149# skip_fail: false
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200150
obutenko830e6f62018-07-03 16:37:13 +0300151#- description: Install designate
152# cmd: salt --hard-crash --state-output=mixed --state-verbose=False
153# -C 'I@designate:server' state.sls designate -b 1
154# node_name: {{ HOSTNAME_CFG01 }}
155# retry: {count: 5, delay: 10}
156# skip_fail: false
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200157
158- description: Check neutron agent-list
159 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
160 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
161 node_name: {{ HOSTNAME_CFG01 }}
162 retry: {count: 1, delay: 5}
163 skip_fail: false
164
165- description: Install heat service
166 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
167 -C 'I@heat:server' state.sls heat -b 1
168 node_name: {{ HOSTNAME_CFG01 }}
169 retry: {count: 1, delay: 5}
170 skip_fail: false
171
172- description: Check heat service
173 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
174 -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list'
175 node_name: {{ HOSTNAME_CFG01 }}
176 retry: {count: 5, delay: 10}
177 skip_fail: false
178
179
180- description: Deploy horizon dashboard
181 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
182 -C 'I@horizon:server' state.sls horizon
183 node_name: {{ HOSTNAME_CFG01 }}
184 retry: {count: 1, delay: 5}
185 skip_fail: true
186
187- description: Deploy nginx proxy
188 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
189 -C 'I@nginx:server' state.sls nginx
190 node_name: {{ HOSTNAME_CFG01 }}
191 retry: {count: 1, delay: 5}
192 skip_fail: true
193
194
195# Install compute node
196
197- description: Apply 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: Re-apply(as in doc) formulas for compute node
204 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
205 node_name: {{ HOSTNAME_CFG01 }}
206 retry: {count: 1, delay: 5}
207 skip_fail: false
208
209- description: Check IP on computes
210 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
211 'ip a'
212 node_name: {{ HOSTNAME_CFG01 }}
213 retry: {count: 10, delay: 30}
214 skip_fail: false
215
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200216- description: Create net04_external
217 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
218 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
219 node_name: {{ HOSTNAME_CFG01 }}
220 retry: {count: 1, delay: 30}
221 skip_fail: false
222
223- description: Create subnet_external
224 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
225 '. /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'
226 node_name: {{ HOSTNAME_CFG01 }}
227 retry: {count: 1, delay: 30}
228 skip_fail: false
229
230- description: Create net04
231 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
232 '. /root/keystonercv3; neutron net-create net04'
233 node_name: {{ HOSTNAME_CFG01 }}
234 retry: {count: 1, delay: 30}
235 skip_fail: false
236
237- description: Create subnet_net04
238 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
239 '. /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'
240 node_name: {{ HOSTNAME_CFG01 }}
241 retry: {count: 1, delay: 30}
242 skip_fail: false
243
244- description: Create router
245 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
246 '. /root/keystonercv3; neutron router-create net04_router01'
247 node_name: {{ HOSTNAME_CFG01 }}
248 retry: {count: 1, delay: 30}
249 skip_fail: false
250
251- description: Set geteway
252 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
253 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
254 node_name: {{ HOSTNAME_CFG01 }}
255 retry: {count: 1, delay: 30}
256 skip_fail: false
257
258- description: Add interface
259 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
260 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
261 node_name: {{ HOSTNAME_CFG01 }}
262 retry: {count: 1, delay: 30}
263 skip_fail: false
264
Dennis Dmitriev67aea4a2018-03-14 14:20:20 +0200265- description: sync time
266 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
267 'service ntp stop; ntpd -gq; service ntp start'
268 node_name: {{ HOSTNAME_CFG01 }}
269 retry: {count: 1, delay: 30}
270 skip_fail: false
271
Oleksii Butenko5cd0a162018-06-14 18:18:10 +0300272{{ SHARED.INSTALL_DOCKER_ON_GTW() }}