blob: d8e1ed19613b4223e1723d39e39bbe500382961a [file] [log] [blame]
ibumarskov7e886672018-08-23 13:52:13 +04001{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
2
Dennis Dmitrievab83ea42017-05-12 16:52:45 +03003{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
Tatyana Leontovich47dbd3a2017-06-22 17:36:53 +03004{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
5{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
6{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
Tatyana Leontovichac38bac2017-07-17 14:05:33 +03007{% from 'virtual-mcp-ocata-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
Sergii Golovatiuk50f91892017-08-04 18:11:06 +02008{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
9{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030010
ibumarskov7e886672018-08-23 13:52:13 +040011{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030012
ibumarskov7e886672018-08-23 13:52:13 +040013{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
ibumarskove23c10e2018-08-20 15:47:58 +040014
ibumarskov7e886672018-08-23 13:52:13 +040015{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Dennis Dmitriev4ab889c2017-04-27 14:11:04 +030016
ibumarskov7e886672018-08-23 13:52:13 +040017{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030018
ibumarskov7e886672018-08-23 13:52:13 +040019{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Tatyana Leontovichfa7ae4d2017-04-25 13:46:14 +030020
ibumarskov7e886672018-08-23 13:52:13 +040021{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
Tatyana Leontovichfa7ae4d2017-04-25 13:46:14 +030022
ibumarskov7e886672018-08-23 13:52:13 +040023# install designate backend
Tatyana Leontovich85e822a2017-06-15 11:52:01 +030024- description: Install bind
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
Tatyana Leontovich033aac02017-06-15 15:01:21 +030026 -C 'I@bind:server' state.sls bind
Tatyana Leontovich85e822a2017-06-15 11:52:01 +030027 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: false
30
ibumarskov7e886672018-08-23 13:52:13 +040031{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030032
ibumarskov7e886672018-08-23 13:52:13 +040033{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030034
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030035# Install compute node
36
37- description: Apply formulas for compute node
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 5}
41 skip_fail: true
42
43- description: Re-apply(as in doc) formulas for compute node
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +020047 skip_fail: false
Tatyana Leontovich38be41b2017-04-12 14:45:23 +030048
49- description: Check IP on computes
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
51 'ip a'
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 10, delay: 30}
54 skip_fail: false
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +030055
56
57 # Upload cirros image
58
59- description: Upload cirros image on ctl01
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +040061 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +030062 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 2, delay: 30}
64 skip_fail: false
65
66- description: Register image in glance
67 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +040068 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +030069 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 1, delay: 30}
71 skip_fail: false
72
73- description: Create net04_external
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Tatyana Leontovich674abf82017-07-20 15:44:15 +030075 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +030076 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 30}
78 skip_fail: false
79
80- description: Create subnet_external
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
82 '. /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'
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 30}
85 skip_fail: false
86
87- description: Create net04
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
89 '. /root/keystonercv3; neutron net-create net04'
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 30}
92 skip_fail: false
93
94- description: Create subnet_net04
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
96 '. /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'
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 30}
99 skip_fail: false
100
101- description: Create router
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
103 '. /root/keystonercv3; neutron router-create net04_router01'
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 30}
106 skip_fail: false
107
ibumarskovc075df82018-07-30 13:23:07 +0400108- description: Set gateway
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300109 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
110 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 30}
113 skip_fail: false
114
115- description: Add interface
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
117 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 30}
120 skip_fail: false
121
122- description: Allow all tcp
123 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
124 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
125 node_name: {{ HOSTNAME_CFG01 }}
126 retry: {count: 1, delay: 30}
127 skip_fail: false
128
129- description: Allow all icmp
130 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
131 '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
132 node_name: {{ HOSTNAME_CFG01 }}
133 retry: {count: 1, delay: 30}
134 skip_fail: false
135
Tatyana Leontovich07bc6ed2017-07-25 13:26:48 +0300136- description: sync time
137 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
138 'service ntp stop; ntpd -gq; service ntp start'
139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 1, delay: 30}
141 skip_fail: false
142
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300143# Configure cinder-volume salt-call
144- description: Set disks 01
145 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
Tatyana Leontovich135d8152017-06-27 16:10:42 +0300146 node_name: {{ HOSTNAME_CTL01 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300147 retry: {count: 1, delay: 30}
148 skip_fail: false
149
150- description: Set disks 02
151 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
152 node_name: {{ HOSTNAME_CTL02 }}
153 retry: {count: 1, delay: 30}
154 skip_fail: false
155
156- description: Set disks 03
157 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
158 node_name: {{ HOSTNAME_CTL03 }}
159 retry: {count: 1, delay: 30}
160 skip_fail: false
161
162- description: Create partitions 01
163 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
164 node_name: {{ HOSTNAME_CTL01 }}
165 retry: {count: 1, delay: 30}
166 skip_fail: false
167
168- description: Create partitions 02
169 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300170 node_name: {{ HOSTNAME_CTL02 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300171 retry: {count: 1, delay: 30}
172 skip_fail: false
173
174- description: Create partitions 03
175 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
sgudz2e393392017-10-17 12:51:26 +0300176 node_name: {{ HOSTNAME_CTL03 }}
Oleksandr Ivashchenkoa95a72b2017-06-06 15:55:59 +0300177 retry: {count: 1, delay: 30}
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300178 skip_fail: false
179
180- description: create volume_group
181 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 1, delay: 30}
184 skip_fail: false
185
186- description: Install cinder-volume
187 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 1, delay: 30}
190 skip_fail: false
191
192- description: Install crudini
193 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
194 node_name: {{ HOSTNAME_CFG01 }}
195 retry: {count: 1, delay: 30}
196 skip_fail: false
197
198- description: Temporary WR set enabled backends value 01
199 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
200 node_name: {{ HOSTNAME_CTL01 }}
201 retry: {count: 1, delay: 30}
202 skip_fail: false
203
204- description: Temporary WR set enabled backends value 02
205 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
206 node_name: {{ HOSTNAME_CTL02 }}
207 retry: {count: 1, delay: 30}
208 skip_fail: false
209
210- description: Temporary WR set enabled backends value 03
211 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
212 node_name: {{ HOSTNAME_CTL03 }}
213 retry: {count: 1, delay: 30}
214 skip_fail: false
215
Tatyana Leontovich47f7bfe2018-01-05 13:36:09 +0200216- description: Restart cinder volume
217 cmd: |
218 salt -C 'I@cinder:controller' service.restart cinder-volume;
219 node_name: {{ HOSTNAME_CFG01 }}
220 retry: {count: 2, delay: 5}
221 skip_fail: false
222
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300223- description: Install docker.io on gtw
224 cmd: salt-call cmd.run 'apt-get install docker.io -y'
225 node_name: {{ HOSTNAME_GTW01 }}
226 retry: {count: 1, delay: 30}
227 skip_fail: false
228
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200229- description: Enable forward policy
230 cmd: iptables --policy FORWARD ACCEPT
231 node_name: {{ HOSTNAME_GTW01 }}
232 retry: {count: 1, delay: 30}
233 skip_fail: false
234
Tatyana Leontovichac38bac2017-07-17 14:05:33 +0300235- description: create rc file on cfg
236 cmd: scp ctl01:/root/keystonercv3 /root
237 node_name: {{ HOSTNAME_CFG01 }}
238 retry: {count: 1, delay: 30}
239 skip_fail: false
240
241- description: Copy rc file
242 cmd: scp /root/keystonercv3 gtw01:/root
243 node_name: {{ HOSTNAME_CFG01 }}
244 retry: {count: 1, delay: 30}
245 skip_fail: false