blob: eade071b1c03ed909ae42dbc87a2178608b4dd92 [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
ibumarskov7bdc7ed2018-08-24 12:06:38 +040011# Deploy nginx before openstack services (PROD-22740)
12- description: Deploy nginx proxy
13 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
14 -C 'I@nginx:server' state.sls nginx
15 node_name: {{ HOSTNAME_CFG01 }}
16 retry: {count: 1, delay: 5}
17 skip_fail: true
18
sgudz62df2fc2018-10-09 12:26:19 +030019{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040020
ibumarskov7e886672018-08-23 13:52:13 +040021{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
22
23{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
24
25{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
26
ibumarskov7bdc7ed2018-08-24 12:06:38 +040027# SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON
ibumarskov7e886672018-08-23 13:52:13 +040028
29- description: Install neutron service on primary node
ibumarskov76aa5c72018-06-13 10:15:37 +040030 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040031 -C "I@neutron:server and *01*" state.sls neutron.server
ibumarskove23c10e2018-08-20 15:47:58 +040032 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 5}
34 skip_fail: false
35
ibumarskov7e886672018-08-23 13:52:13 +040036- description: Install neutron service on other nodes
ibumarskove23c10e2018-08-20 15:47:58 +040037 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040038 -C "I@neutron:server" state.sls neutron.server
ibumarskov76aa5c72018-06-13 10:15:37 +040039 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 5}
41 skip_fail: false
42
43- description: Install neutron on gtw node
44 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
45 -C 'I@neutron:gateway' state.sls neutron
46 node_name: {{ HOSTNAME_CFG01 }}
47 retry: {count: 1, delay: 5}
48 skip_fail: false
49
ibumarskovc075df82018-07-30 13:23:07 +040050# WORKAROUND PROD-20976
51- description: WORKAROUND PROD-20976
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
53 -C 'I@neutron:server or I@neutron:gateway' cmd.run "sed -i
54 's/#min_l3_agents_per_router = 2/min_l3_agents_per_router = 1/'
55 /etc/neutron/neutron.conf"
56 node_name: {{ HOSTNAME_CFG01 }}
57 retry: {count: 1, delay: 5}
58 skip_fail: false
59
ibumarskovf1086952018-08-23 16:32:59 +040060- description: Restart Neutron services
61 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
62 -C 'I@neutron:server or I@neutron:gateway' cmd.run 'systemctl restart
63 neutron*'
64 node_name: {{ HOSTNAME_CFG01 }}
65 retry: {count: 1, delay: 5}
66 skip_fail: false
67
ibumarskov76aa5c72018-06-13 10:15:37 +040068- description: Check neutron agent-list
69 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
70 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
71 node_name: {{ HOSTNAME_CFG01 }}
ibumarskov7bdc7ed2018-08-24 12:06:38 +040072 retry: {count: 3, delay: 20}
ibumarskov76aa5c72018-06-13 10:15:37 +040073 skip_fail: false
74
ibumarskov7e886672018-08-23 13:52:13 +040075{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
76
77# install designate backend
78- description: Install powerdns
ibumarskov76aa5c72018-06-13 10:15:37 +040079 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040080 -C 'I@powerdns:server' state.sls powerdns.server
ibumarskov76aa5c72018-06-13 10:15:37 +040081 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 1, delay: 5}
83 skip_fail: false
84
ibumarskov7e886672018-08-23 13:52:13 +040085{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040086
ibumarskov7e886672018-08-23 13:52:13 +040087{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040088
89# Install compute node
90
91- description: Apply formulas for compute node
92 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
93 node_name: {{ HOSTNAME_CFG01 }}
94 retry: {count: 1, delay: 5}
95 skip_fail: true
96
97- description: Re-apply(as in doc) formulas for compute node
98 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
99 node_name: {{ HOSTNAME_CFG01 }}
100 retry: {count: 1, delay: 5}
101 skip_fail: false
102
103- description: Check IP on computes
104 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
105 'ip a'
106 node_name: {{ HOSTNAME_CFG01 }}
107 retry: {count: 10, delay: 30}
108 skip_fail: false
109
110
111 # Upload cirros image
112
113- description: Upload cirros image on ctl01
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400115 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
ibumarskov76aa5c72018-06-13 10:15:37 +0400116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 2, delay: 30}
118 skip_fail: false
119
120- description: Register image in glance
121 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400122 '. /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 +0400123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 30}
125 skip_fail: false
126
127- description: Create net04_external
128 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
129 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
130 node_name: {{ HOSTNAME_CFG01 }}
131 retry: {count: 1, delay: 30}
132 skip_fail: false
133
134- description: Create subnet_external
135 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
136 '. /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'
137 node_name: {{ HOSTNAME_CFG01 }}
138 retry: {count: 1, delay: 30}
139 skip_fail: false
140
141- description: Create net04
142 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
143 '. /root/keystonercv3; neutron net-create net04'
144 node_name: {{ HOSTNAME_CFG01 }}
145 retry: {count: 1, delay: 30}
146 skip_fail: false
147
148- description: Create subnet_net04
149 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
150 '. /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'
151 node_name: {{ HOSTNAME_CFG01 }}
152 retry: {count: 1, delay: 30}
153 skip_fail: false
154
155- description: Create router
156 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
157 '. /root/keystonercv3; neutron router-create net04_router01'
158 node_name: {{ HOSTNAME_CFG01 }}
159 retry: {count: 1, delay: 30}
160 skip_fail: false
161
ibumarskovc075df82018-07-30 13:23:07 +0400162- description: Set gateway
ibumarskov76aa5c72018-06-13 10:15:37 +0400163 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
164 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 1, delay: 30}
167 skip_fail: false
168
169- description: Add interface
170 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
171 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
172 node_name: {{ HOSTNAME_CFG01 }}
173 retry: {count: 1, delay: 30}
174 skip_fail: false
175
ibumarskovc075df82018-07-30 13:23:07 +0400176- description: Allow all tcp
177 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
178 '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
179 node_name: {{ HOSTNAME_CFG01 }}
180 retry: {count: 1, delay: 30}
181 skip_fail: false
182
183- description: Allow all icmp
184 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
185 '. /root/keystonercv3; openstack security group rule create --proto icmp default'
186 node_name: {{ HOSTNAME_CFG01 }}
187 retry: {count: 1, delay: 30}
188 skip_fail: false
ibumarskov76aa5c72018-06-13 10:15:37 +0400189
190- description: sync time
191 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
192 'service ntp stop; ntpd -gq; service ntp start'
193 node_name: {{ HOSTNAME_CFG01 }}
194 retry: {count: 1, delay: 30}
195 skip_fail: false
196
ibumarskov76aa5c72018-06-13 10:15:37 +0400197- description: Install docker.io on gtw
198 cmd: salt-call cmd.run 'apt-get install docker.io -y'
199 node_name: {{ HOSTNAME_GTW01 }}
200 retry: {count: 1, delay: 30}
201 skip_fail: false
202
203- description: Enable forward policy
204 cmd: iptables --policy FORWARD ACCEPT
205 node_name: {{ HOSTNAME_GTW01 }}
206 retry: {count: 1, delay: 30}
207 skip_fail: false
208
209- description: create rc file on cfg
210 cmd: scp ctl01:/root/keystonercv3 /root
211 node_name: {{ HOSTNAME_CFG01 }}
212 retry: {count: 1, delay: 30}
213 skip_fail: false
214
215- description: Copy rc file
216 cmd: scp /root/keystonercv3 gtw01:/root
217 node_name: {{ HOSTNAME_CFG01 }}
218 retry: {count: 1, delay: 30}
219 skip_fail: false