blob: 74ee90fb5c900acae2d2d57bb10206cd4eee24d3 [file] [log] [blame]
ibumarskov7e886672018-08-23 13:52:13 +04001{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
2
ibumarskov76aa5c72018-06-13 10:15:37 +04003{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
4{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
5{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
6{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
7{% from 'cookied-mcp-mitaka-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
8{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
9{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX 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
ibumarskov76aa5c72018-06-13 10:15:37 +040052- description: Check neutron agent-list
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 5}
57 skip_fail: false
58
ibumarskov7e886672018-08-23 13:52:13 +040059{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
60
61# install designate backend
62- description: Install powerdns
ibumarskov76aa5c72018-06-13 10:15:37 +040063 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040064 -C 'I@powerdns:server' state.sls powerdns.server
ibumarskov76aa5c72018-06-13 10:15:37 +040065 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
ibumarskov7e886672018-08-23 13:52:13 +040069{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040070
ibumarskov7e886672018-08-23 13:52:13 +040071{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040072
73# Install compute node
74
75- description: Apply formulas for compute node
76 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
77 node_name: {{ HOSTNAME_CFG01 }}
78 retry: {count: 1, delay: 5}
79 skip_fail: true
80
81- description: Re-apply(as in doc) formulas for compute node
82 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 5}
85 skip_fail: false
86
87- description: Check IP on computes
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
89 'ip a'
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 10, delay: 30}
92 skip_fail: false
93
94
95 # Upload cirros image
96
97- description: Upload cirros image on ctl01
98 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +040099 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
ibumarskov76aa5c72018-06-13 10:15:37 +0400100 node_name: {{ HOSTNAME_CFG01 }}
101 retry: {count: 2, delay: 30}
102 skip_fail: false
103
104- description: Register image in glance
105 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400106 '. /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 +0400107 node_name: {{ HOSTNAME_CFG01 }}
108 retry: {count: 1, delay: 30}
109 skip_fail: false
110
111- description: Create net04_external
112 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
113 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
114 node_name: {{ HOSTNAME_CFG01 }}
115 retry: {count: 1, delay: 30}
116 skip_fail: false
117
118- description: Create subnet_external
119 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
120 '. /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'
121 node_name: {{ HOSTNAME_CFG01 }}
122 retry: {count: 1, delay: 30}
123 skip_fail: false
124
125- description: Create net04
126 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
127 '. /root/keystonercv3; neutron net-create net04'
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 30}
130 skip_fail: false
131
132- description: Create subnet_net04
133 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
134 '. /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'
135 node_name: {{ HOSTNAME_CFG01 }}
136 retry: {count: 1, delay: 30}
137 skip_fail: false
138
139- description: Create router
140 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
141 '. /root/keystonercv3; neutron router-create net04_router01'
142 node_name: {{ HOSTNAME_CFG01 }}
143 retry: {count: 1, delay: 30}
144 skip_fail: false
145
ibumarskovc075df82018-07-30 13:23:07 +0400146- description: Set gateway
ibumarskov76aa5c72018-06-13 10:15:37 +0400147 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
148 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 1, delay: 30}
151 skip_fail: false
152
153- description: Add interface
154 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
155 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
156 node_name: {{ HOSTNAME_CFG01 }}
157 retry: {count: 1, delay: 30}
158 skip_fail: false
159
ibumarskovc075df82018-07-30 13:23:07 +0400160- description: Allow all tcp
161 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
162 '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 1, delay: 30}
165 skip_fail: false
166
167- description: Allow all icmp
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
169 '. /root/keystonercv3; openstack security group rule create --proto icmp default'
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 1, delay: 30}
172 skip_fail: false
ibumarskov76aa5c72018-06-13 10:15:37 +0400173
174- description: sync time
175 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
176 'service ntp stop; ntpd -gq; service ntp start'
177 node_name: {{ HOSTNAME_CFG01 }}
178 retry: {count: 1, delay: 30}
179 skip_fail: false
180
181# Configure cinder-volume salt-call
182- description: Set disks 01
183 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
184 node_name: {{ HOSTNAME_CTL01 }}
185 retry: {count: 1, delay: 30}
186 skip_fail: false
187
188- description: Set disks 02
189 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
190 node_name: {{ HOSTNAME_CTL02 }}
191 retry: {count: 1, delay: 30}
192 skip_fail: false
193
194- description: Set disks 03
195 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
196 node_name: {{ HOSTNAME_CTL03 }}
197 retry: {count: 1, delay: 30}
198 skip_fail: false
199
200- description: Create partitions 01
201 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
202 node_name: {{ HOSTNAME_CTL01 }}
203 retry: {count: 1, delay: 30}
204 skip_fail: false
205
206- description: Create partitions 02
207 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
208 node_name: {{ HOSTNAME_CTL02 }}
209 retry: {count: 1, delay: 30}
210 skip_fail: false
211
212- description: Create partitions 03
213 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
214 node_name: {{ HOSTNAME_CTL03 }}
215 retry: {count: 1, delay: 30}
216 skip_fail: false
217
218- description: create volume_group
219 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
220 node_name: {{ HOSTNAME_CFG01 }}
221 retry: {count: 1, delay: 30}
222 skip_fail: false
223
224- description: Install cinder-volume
225 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
226 node_name: {{ HOSTNAME_CFG01 }}
227 retry: {count: 1, delay: 30}
228 skip_fail: false
229
230- description: Install crudini
231 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
232 node_name: {{ HOSTNAME_CFG01 }}
233 retry: {count: 1, delay: 30}
234 skip_fail: false
235
236- description: Temporary WR set enabled backends value 01
237 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
238 node_name: {{ HOSTNAME_CTL01 }}
239 retry: {count: 1, delay: 30}
240 skip_fail: false
241
242- description: Temporary WR set enabled backends value 02
243 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
244 node_name: {{ HOSTNAME_CTL02 }}
245 retry: {count: 1, delay: 30}
246 skip_fail: false
247
248- description: Temporary WR set enabled backends value 03
249 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
250 node_name: {{ HOSTNAME_CTL03 }}
251 retry: {count: 1, delay: 30}
252 skip_fail: false
253
254- description: Restart cinder volume
255 cmd: |
256 salt -C 'I@cinder:controller' service.restart cinder-volume;
257 node_name: {{ HOSTNAME_CFG01 }}
258 retry: {count: 2, delay: 5}
259 skip_fail: false
260
261- description: Install docker.io on gtw
262 cmd: salt-call cmd.run 'apt-get install docker.io -y'
263 node_name: {{ HOSTNAME_GTW01 }}
264 retry: {count: 1, delay: 30}
265 skip_fail: false
266
267- description: Enable forward policy
268 cmd: iptables --policy FORWARD ACCEPT
269 node_name: {{ HOSTNAME_GTW01 }}
270 retry: {count: 1, delay: 30}
271 skip_fail: false
272
273- description: create rc file on cfg
274 cmd: scp ctl01:/root/keystonercv3 /root
275 node_name: {{ HOSTNAME_CFG01 }}
276 retry: {count: 1, delay: 30}
277 skip_fail: false
278
279- description: Copy rc file
280 cmd: scp /root/keystonercv3 gtw01:/root
281 node_name: {{ HOSTNAME_CFG01 }}
282 retry: {count: 1, delay: 30}
283 skip_fail: false