blob: c10aa281b2da22fad03c13483670711ac75489a8 [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 %}
Pavel Glazov78e6c592018-10-24 12:20:12 +040010{% import 'shared-salt.yaml' as SHARED with context %}
Pavel Glazovca1de372018-08-21 15:38:00 +040011
12# 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() }}
Pavel Glazovca1de372018-08-21 15:38:00 +040021
22{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
23
24{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
25
26{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
27
28# {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
29
30- description: Install neutron service on primary node
31 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
32 -C "I@neutron:server and *01*" state.sls neutron.server
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 5}
35 skip_fail: false
36
37- description: Install neutron service on other nodes
38 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
39 -C "I@neutron:server" state.sls neutron.server
40 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
51# 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
61- 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
69- 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 }}
73 retry: {count: 3, delay: 20}
74 skip_fail: false
75
76{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
77
78# install designate backend
79- description: Install bind
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@bind:server' state.sls bind
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 1, delay: 5}
84 skip_fail: false
85
86{{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }}
87
88{{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
89
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
116 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2'
117 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
123 '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2'
124 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
163- description: Set gateway
164 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
177- description: Allow all tcp
178 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
179 '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
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; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
187 node_name: {{ HOSTNAME_CFG01 }}
188 retry: {count: 1, delay: 30}
189 skip_fail: false
190
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() }}
Pavel Glazovca1de372018-08-21 15:38:00 +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