blob: 52c0fdbcb172ccee39657518dd910d21f9eccc60 [file] [log] [blame]
Pavel Glazovca1de372018-08-21 15:38:00 +04001{% from 'cookied-mcp-newton-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-newton-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'cookied-mcp-newton-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'cookied-mcp-newton-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'cookied-mcp-newton-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
9{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
10
11# 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() }}
Pavel Glazovca1de372018-08-21 15:38:00 +040020
21{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
22
23{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
24
25{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
26
27# {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
28
29- description: Install neutron service on primary node
30 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
31 -C "I@neutron:server and *01*" state.sls neutron.server
32 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 5}
34 skip_fail: false
35
36- description: Install neutron service on other nodes
37 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
38 -C "I@neutron:server" state.sls neutron.server
39 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
50# 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
60- 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
68- 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 }}
72 retry: {count: 3, delay: 20}
73 skip_fail: false
74
75{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
76
77# install designate backend
78- description: Install bind
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
80 -C 'I@bind:server' state.sls bind
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 1, delay: 5}
83 skip_fail: false
84
85{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
86
87{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
88
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
115 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
116 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
122 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2'
123 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
162- description: Set gateway
163 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
176- description: Allow all tcp
177 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
178 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
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; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
186 node_name: {{ HOSTNAME_CFG01 }}
187 retry: {count: 1, delay: 30}
188 skip_fail: false
189
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
Pavel Glazovca1de372018-08-21 15:38:00 +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
Pavel Glazovd0349c82018-10-18 14:23:13 +0400220
221- description: WORKAROUND PROD-23354
222 cmd: sed -n 's/max_microversion = 2.42/max_microversion = 2.38/;w /var/log/lvm_mcp_newton.conf' /var/log/lvm_mcp.conf
223 node_name: {{ HOSTNAME_GTW01 }}
224 retry: {count: 1, delay: 30}
225 skip_fail: false