blob: d6f957eb35b9c283740cbb3c1e2accb559f02d34 [file] [log] [blame]
ibumarskov76aa5c72018-06-13 10:15:37 +04001{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'cookied-mcp-mitaka-ovs/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
ibumarskov942417e2018-08-23 22:05:59 +04009{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
10
ibumarskov7e886672018-08-23 13:52:13 +040011{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040012
ibumarskov7e886672018-08-23 13:52:13 +040013{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
14
15{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
16
17{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
18
19#{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
20
21- description: Install neutron service on primary node
ibumarskov76aa5c72018-06-13 10:15:37 +040022 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040023 -C "I@neutron:server and *01*" state.sls neutron.server
ibumarskove23c10e2018-08-20 15:47:58 +040024 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 1, delay: 5}
26 skip_fail: false
27
ibumarskov7e886672018-08-23 13:52:13 +040028- description: Install neutron service on other nodes
ibumarskove23c10e2018-08-20 15:47:58 +040029 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040030 -C "I@neutron:server" state.sls neutron.server
ibumarskov76aa5c72018-06-13 10:15:37 +040031 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 5}
33 skip_fail: false
34
35- description: Install neutron on gtw node
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@neutron:gateway' state.sls neutron
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
ibumarskovc075df82018-07-30 13:23:07 +040042# WORKAROUND PROD-20976
43- description: WORKAROUND PROD-20976
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@neutron:server or I@neutron:gateway' cmd.run "sed -i
46 's/#min_l3_agents_per_router = 2/min_l3_agents_per_router = 1/'
47 /etc/neutron/neutron.conf"
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
ibumarskovf1086952018-08-23 16:32:59 +040052- description: Restart Neutron services
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@neutron:server or I@neutron:gateway' cmd.run 'systemctl restart
55 neutron*'
56 node_name: {{ HOSTNAME_CFG01 }}
57 retry: {count: 1, delay: 5}
58 skip_fail: false
59
ibumarskov76aa5c72018-06-13 10:15:37 +040060- description: Check neutron agent-list
61 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
62 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
63 node_name: {{ HOSTNAME_CFG01 }}
64 retry: {count: 1, delay: 5}
65 skip_fail: false
66
ibumarskov7e886672018-08-23 13:52:13 +040067{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
68
69# install designate backend
70- description: Install powerdns
ibumarskov76aa5c72018-06-13 10:15:37 +040071 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040072 -C 'I@powerdns:server' state.sls powerdns.server
ibumarskov76aa5c72018-06-13 10:15:37 +040073 node_name: {{ HOSTNAME_CFG01 }}
74 retry: {count: 1, delay: 5}
75 skip_fail: false
76
ibumarskov7e886672018-08-23 13:52:13 +040077{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040078
ibumarskov7e886672018-08-23 13:52:13 +040079{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040080
81# Install compute node
82
83- description: Apply formulas for compute node
84 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 5}
87 skip_fail: true
88
89- description: Re-apply(as in doc) formulas for compute node
90 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
91 node_name: {{ HOSTNAME_CFG01 }}
92 retry: {count: 1, delay: 5}
93 skip_fail: false
94
95- description: Check IP on computes
96 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
97 'ip a'
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 10, delay: 30}
100 skip_fail: false
101
102
103 # Upload cirros image
104
105- description: Upload cirros image on ctl01
106 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400107 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
ibumarskov76aa5c72018-06-13 10:15:37 +0400108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 2, delay: 30}
110 skip_fail: false
111
112- description: Register image in glance
113 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400114 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2'
ibumarskov76aa5c72018-06-13 10:15:37 +0400115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 30}
117 skip_fail: false
118
119- description: Create net04_external
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
121 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 30}
124 skip_fail: false
125
126- description: Create subnet_external
127 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
128 '. /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'
129 node_name: {{ HOSTNAME_CFG01 }}
130 retry: {count: 1, delay: 30}
131 skip_fail: false
132
133- description: Create net04
134 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
135 '. /root/keystonercv3; neutron net-create net04'
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 1, delay: 30}
138 skip_fail: false
139
140- description: Create subnet_net04
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
142 '. /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'
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 30}
145 skip_fail: false
146
147- description: Create router
148 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
149 '. /root/keystonercv3; neutron router-create net04_router01'
150 node_name: {{ HOSTNAME_CFG01 }}
151 retry: {count: 1, delay: 30}
152 skip_fail: false
153
ibumarskovc075df82018-07-30 13:23:07 +0400154- description: Set gateway
ibumarskov76aa5c72018-06-13 10:15:37 +0400155 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
156 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
157 node_name: {{ HOSTNAME_CFG01 }}
158 retry: {count: 1, delay: 30}
159 skip_fail: false
160
161- description: Add interface
162 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
163 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
164 node_name: {{ HOSTNAME_CFG01 }}
165 retry: {count: 1, delay: 30}
166 skip_fail: false
167
ibumarskovc075df82018-07-30 13:23:07 +0400168- description: Allow all tcp
169 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
170 '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
171 node_name: {{ HOSTNAME_CFG01 }}
172 retry: {count: 1, delay: 30}
173 skip_fail: false
174
175- description: Allow all icmp
176 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
177 '. /root/keystonercv3; openstack security group rule create --proto icmp default'
178 node_name: {{ HOSTNAME_CFG01 }}
179 retry: {count: 1, delay: 30}
180 skip_fail: false
ibumarskov76aa5c72018-06-13 10:15:37 +0400181
182- description: sync time
183 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
184 'service ntp stop; ntpd -gq; service ntp start'
185 node_name: {{ HOSTNAME_CFG01 }}
186 retry: {count: 1, delay: 30}
187 skip_fail: false
188
189# Configure cinder-volume salt-call
190- description: Set disks 01
191 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
192 node_name: {{ HOSTNAME_CTL01 }}
193 retry: {count: 1, delay: 30}
194 skip_fail: false
195
196- description: Set disks 02
197 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
198 node_name: {{ HOSTNAME_CTL02 }}
199 retry: {count: 1, delay: 30}
200 skip_fail: false
201
202- description: Set disks 03
203 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
204 node_name: {{ HOSTNAME_CTL03 }}
205 retry: {count: 1, delay: 30}
206 skip_fail: false
207
208- description: Create partitions 01
209 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
210 node_name: {{ HOSTNAME_CTL01 }}
211 retry: {count: 1, delay: 30}
212 skip_fail: false
213
214- description: Create partitions 02
215 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
216 node_name: {{ HOSTNAME_CTL02 }}
217 retry: {count: 1, delay: 30}
218 skip_fail: false
219
220- description: Create partitions 03
221 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
222 node_name: {{ HOSTNAME_CTL03 }}
223 retry: {count: 1, delay: 30}
224 skip_fail: false
225
226- description: create volume_group
227 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
228 node_name: {{ HOSTNAME_CFG01 }}
229 retry: {count: 1, delay: 30}
230 skip_fail: false
231
232- description: Install cinder-volume
233 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
234 node_name: {{ HOSTNAME_CFG01 }}
235 retry: {count: 1, delay: 30}
236 skip_fail: false
237
238- description: Install crudini
239 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
240 node_name: {{ HOSTNAME_CFG01 }}
241 retry: {count: 1, delay: 30}
242 skip_fail: false
243
244- description: Temporary WR set enabled backends value 01
245 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
246 node_name: {{ HOSTNAME_CTL01 }}
247 retry: {count: 1, delay: 30}
248 skip_fail: false
249
250- description: Temporary WR set enabled backends value 02
251 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
252 node_name: {{ HOSTNAME_CTL02 }}
253 retry: {count: 1, delay: 30}
254 skip_fail: false
255
256- description: Temporary WR set enabled backends value 03
257 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
258 node_name: {{ HOSTNAME_CTL03 }}
259 retry: {count: 1, delay: 30}
260 skip_fail: false
261
262- description: Restart cinder volume
263 cmd: |
264 salt -C 'I@cinder:controller' service.restart cinder-volume;
265 node_name: {{ HOSTNAME_CFG01 }}
266 retry: {count: 2, delay: 5}
267 skip_fail: false
268
269- description: Install docker.io on gtw
270 cmd: salt-call cmd.run 'apt-get install docker.io -y'
271 node_name: {{ HOSTNAME_GTW01 }}
272 retry: {count: 1, delay: 30}
273 skip_fail: false
274
275- description: Enable forward policy
276 cmd: iptables --policy FORWARD ACCEPT
277 node_name: {{ HOSTNAME_GTW01 }}
278 retry: {count: 1, delay: 30}
279 skip_fail: false
280
281- description: create rc file on cfg
282 cmd: scp ctl01:/root/keystonercv3 /root
283 node_name: {{ HOSTNAME_CFG01 }}
284 retry: {count: 1, delay: 30}
285 skip_fail: false
286
287- description: Copy rc file
288 cmd: scp /root/keystonercv3 gtw01:/root
289 node_name: {{ HOSTNAME_CFG01 }}
290 retry: {count: 1, delay: 30}
291 skip_fail: false