blob: 6672997d55503442c72acde7eabf8332c54e39a4 [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 %}
Pavel Glazov78e6c592018-10-24 12:20:12 +040010{% import 'shared-salt.yaml' as SHARED with context %}
ibumarskov942417e2018-08-23 22:05:59 +040011
ibumarskov7bdc7ed2018-08-24 12:06:38 +040012# Deploy nginx before openstack services (PROD-22740)
13- description: Deploy nginx proxy
14 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
15 -C 'I@nginx:server' state.sls nginx
16 node_name: {{ HOSTNAME_CFG01 }}
17 retry: {count: 1, delay: 5}
18 skip_fail: true
19
sgudz62df2fc2018-10-09 12:26:19 +030020{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040021
ibumarskov7e886672018-08-23 13:52:13 +040022{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
23
24{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
25
26{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
27
ibumarskov7bdc7ed2018-08-24 12:06:38 +040028# SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON
ibumarskov7e886672018-08-23 13:52:13 +040029
30- description: Install neutron service on primary node
ibumarskov76aa5c72018-06-13 10:15:37 +040031 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040032 -C "I@neutron:server and *01*" state.sls neutron.server
ibumarskove23c10e2018-08-20 15:47:58 +040033 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 5}
35 skip_fail: false
36
ibumarskov7e886672018-08-23 13:52:13 +040037- description: Install neutron service on other nodes
ibumarskove23c10e2018-08-20 15:47:58 +040038 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040039 -C "I@neutron:server" state.sls neutron.server
ibumarskov76aa5c72018-06-13 10:15:37 +040040 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 1, delay: 5}
42 skip_fail: false
43
44- description: Install neutron on gtw node
45 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
46 -C 'I@neutron:gateway' state.sls neutron
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: false
50
ibumarskovc075df82018-07-30 13:23:07 +040051# WORKAROUND PROD-20976
52- description: WORKAROUND PROD-20976
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@neutron:server or I@neutron:gateway' cmd.run "sed -i
55 's/#min_l3_agents_per_router = 2/min_l3_agents_per_router = 1/'
56 /etc/neutron/neutron.conf"
57 node_name: {{ HOSTNAME_CFG01 }}
58 retry: {count: 1, delay: 5}
59 skip_fail: false
60
ibumarskovf1086952018-08-23 16:32:59 +040061- description: Restart Neutron services
62 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
63 -C 'I@neutron:server or I@neutron:gateway' cmd.run 'systemctl restart
64 neutron*'
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
ibumarskov76aa5c72018-06-13 10:15:37 +040069- description: Check neutron agent-list
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
71 -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
72 node_name: {{ HOSTNAME_CFG01 }}
ibumarskov7bdc7ed2018-08-24 12:06:38 +040073 retry: {count: 3, delay: 20}
ibumarskov76aa5c72018-06-13 10:15:37 +040074 skip_fail: false
75
ibumarskov7e886672018-08-23 13:52:13 +040076{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
77
78# install designate backend
79- description: Install powerdns
ibumarskov76aa5c72018-06-13 10:15:37 +040080 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
ibumarskov7e886672018-08-23 13:52:13 +040081 -C 'I@powerdns:server' state.sls powerdns.server
ibumarskov76aa5c72018-06-13 10:15:37 +040082 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 1, delay: 5}
84 skip_fail: false
85
ibumarskov7e886672018-08-23 13:52:13 +040086{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040087
ibumarskov7e886672018-08-23 13:52:13 +040088{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
ibumarskov76aa5c72018-06-13 10:15:37 +040089
90# Install compute node
91
92- description: Apply formulas for compute node
93 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
94 node_name: {{ HOSTNAME_CFG01 }}
95 retry: {count: 1, delay: 5}
96 skip_fail: true
97
98- description: Re-apply(as in doc) formulas for compute node
99 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
100 node_name: {{ HOSTNAME_CFG01 }}
101 retry: {count: 1, delay: 5}
102 skip_fail: false
103
104- description: Check IP on computes
105 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
106 'ip a'
107 node_name: {{ HOSTNAME_CFG01 }}
108 retry: {count: 10, delay: 30}
109 skip_fail: false
110
111
112 # Upload cirros image
113
114- description: Upload cirros image on ctl01
115 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400116 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
ibumarskov76aa5c72018-06-13 10:15:37 +0400117 node_name: {{ HOSTNAME_CFG01 }}
118 retry: {count: 2, delay: 30}
119 skip_fail: false
120
121- description: Register image in glance
122 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
ibumarskov2cea0d42018-07-24 08:40:50 +0400123 '. /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 +0400124 node_name: {{ HOSTNAME_CFG01 }}
125 retry: {count: 1, delay: 30}
126 skip_fail: false
127
128- description: Create net04_external
129 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
130 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
131 node_name: {{ HOSTNAME_CFG01 }}
132 retry: {count: 1, delay: 30}
133 skip_fail: false
134
135- description: Create subnet_external
136 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
137 '. /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'
138 node_name: {{ HOSTNAME_CFG01 }}
139 retry: {count: 1, delay: 30}
140 skip_fail: false
141
142- description: Create net04
143 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
144 '. /root/keystonercv3; neutron net-create net04'
145 node_name: {{ HOSTNAME_CFG01 }}
146 retry: {count: 1, delay: 30}
147 skip_fail: false
148
149- description: Create subnet_net04
150 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
151 '. /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'
152 node_name: {{ HOSTNAME_CFG01 }}
153 retry: {count: 1, delay: 30}
154 skip_fail: false
155
156- description: Create router
157 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
158 '. /root/keystonercv3; neutron router-create net04_router01'
159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 1, delay: 30}
161 skip_fail: false
162
ibumarskovc075df82018-07-30 13:23:07 +0400163- description: Set gateway
ibumarskov76aa5c72018-06-13 10:15:37 +0400164 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
165 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
166 node_name: {{ HOSTNAME_CFG01 }}
167 retry: {count: 1, delay: 30}
168 skip_fail: false
169
170- description: Add interface
171 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
172 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
173 node_name: {{ HOSTNAME_CFG01 }}
174 retry: {count: 1, delay: 30}
175 skip_fail: false
176
ibumarskovc075df82018-07-30 13:23:07 +0400177- description: Allow all tcp
178 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
179 '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default'
180 node_name: {{ HOSTNAME_CFG01 }}
181 retry: {count: 1, delay: 30}
182 skip_fail: false
183
184- description: Allow all icmp
185 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
186 '. /root/keystonercv3; openstack security group rule create --proto icmp default'
187 node_name: {{ HOSTNAME_CFG01 }}
188 retry: {count: 1, delay: 30}
189 skip_fail: false
ibumarskov76aa5c72018-06-13 10:15:37 +0400190
191- description: sync time
192 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
193 'service ntp stop; ntpd -gq; service ntp start'
194 node_name: {{ HOSTNAME_CFG01 }}
195 retry: {count: 1, delay: 30}
196 skip_fail: false
197
Pavel Glazov78e6c592018-10-24 12:20:12 +0400198{{ SHARED.INSTALL_DOCKER_ON_GTW() }}
ibumarskov76aa5c72018-06-13 10:15:37 +0400199
200- description: create rc file on cfg
201 cmd: scp ctl01:/root/keystonercv3 /root
202 node_name: {{ HOSTNAME_CFG01 }}
203 retry: {count: 1, delay: 30}
204 skip_fail: false
205
206- description: Copy rc file
207 cmd: scp /root/keystonercv3 gtw01:/root
208 node_name: {{ HOSTNAME_CFG01 }}
209 retry: {count: 1, delay: 30}
210 skip_fail: false