forked from Juniper/contrail-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contrail_config_templates.py
327 lines (291 loc) · 9.52 KB
/
contrail_config_templates.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
import string
api_server_conf_template = string.Template("""
[DEFAULTS]
ifmap_server_ip=$__contrail_ifmap_server_ip__
ifmap_server_port=$__contrail_ifmap_server_port__
ifmap_username=$__contrail_ifmap_username__
ifmap_password=$__contrail_ifmap_password__
redis_server_port=6379
cassandra_server_list=$__contrail_cassandra_server_list__
listen_ip_addr=$__contrail_listen_ip_addr__
listen_port=$__contrail_listen_port__
auth=keystone
multi_tenancy=$__contrail_multi_tenancy__
log_file=$__contrail_log_file__
disc_server_ip=$__contrail_disc_server_ip__
disc_server_port=$__contrail_disc_server_port__
[SECURITY]
use_certs=$__contrail_use_certs__
keyfile=$__contrail_keyfile_location__
certfile=$__contrail_certfile_location__
ca_certs=$__contrail_cacertfile_location__
[KEYSTONE]
auth_host=$__contrail_openstack_ip__
auth_protocol=http
admin_user=$__contrail_admin_user__
admin_password=$__contrail_admin_password__
admin_tenant_name=$__contrail_admin_tenant_name__
$__contrail_memcached_opt__
""")
quantum_conf_template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
multi_tenancy = $__contrail_multi_tenancy__
[KEYSTONE]
;auth_url = http://$__contrail_keystone_ip__:35357/v2.0
;admin_token = $__contrail_admin_token__
admin_user=$__contrail_admin_user__
admin_password=$__contrail_admin_password__
admin_tenant_name=$__contrail_admin_tenant_name__
""")
schema_transformer_conf_template = string.Template("""
[DEFAULTS]
ifmap_server_ip=$__contrail_ifmap_server_ip__
ifmap_server_port=$__contrail_ifmap_server_port__
ifmap_username=$__contrail_ifmap_username__
ifmap_password=$__contrail_ifmap_password__
api_server_ip=$__contrail_api_server_ip__
api_server_port=$__contrail_api_server_port__
zk_server_ip=$__contrail_zookeeper_server_ip__
zk_server_port=$__contrail_zookeeper_server_port__
log_file=$__contrail_log_file__
cassandra_server_list=$__contrail_cassandra_server_list__
disc_server_ip=$__contrail_disc_server_ip__
disc_server_port=$__contrail_disc_server_port__
[SECURITY]
use_certs=$__contrail_use_certs__
keyfile=$__contrail_keyfile_location__
certfile=$__contrail_certfile_location__
ca_certs=$__contrail_cacertfile_location__
[KEYSTONE]
admin_user=$__contrail_admin_user__
admin_password=$__contrail_admin_password__
admin_tenant_name=$__contrail_admin_tenant_name__
""")
svc_monitor_conf_template = string.Template("""
[DEFAULTS]
ifmap_server_ip=$__contrail_ifmap_server_ip__
ifmap_server_port=$__contrail_ifmap_server_port__
ifmap_username=$__contrail_ifmap_username__
ifmap_password=$__contrail_ifmap_password__
api_server_ip=$__contrail_api_server_ip__
api_server_port=$__contrail_api_server_port__
zk_server_ip=$__contrail_zookeeper_server_ip__
zk_server_port=$__contrail_zookeeper_server_port__
log_file=$__contrail_log_file__
cassandra_server_list=$__contrail_cassandra_server_list__
disc_server_ip=$__contrail_disc_server_ip__
disc_server_port=$__contrail_disc_server_port__
rabbit_user=$__contrail_rabbit_user__
rabbit_password=$__contrail_rabbit_password__
[SECURITY]
use_certs=$__contrail_use_certs__
keyfile=$__contrail_keyfile_location__
certfile=$__contrail_certfile_location__
ca_certs=$__contrail_cacertfile_location__
[KEYSTONE]
auth_host=$__contrail_openstack_ip__
admin_user=$__contrail_admin_user__
admin_password=$__contrail_admin_password__
admin_tenant_name=$__contrail_admin_tenant_name__
""")
bgp_param_template = string.Template("""
IFMAP_SERVER=$__contrail_ifmap_srv_ip__
IFMAP_PORT=$__contrail_ifmap_srv_port__
IFMAP_USER=$__contrail_ifmap_usr__
IFMAP_PASWD=$__contrail_ifmap_paswd__
COLLECTOR=$__contrail_collector__
COLLECTOR_PORT=$__contrail_collector_port__
DISCOVERY=$__contrail_discovery_ip__
HOSTNAME=$__contrail_hostname__
HOSTIP=$__contrail_host_ip__
BGP_PORT=$__contrail_bgp_port__
CERT_OPTS=$__contrail_cert_ops__
CONTROL_LOGFILE=$__contrail_logfile__
LOG_LOCAL=$__contrail_log_local__
""")
dns_param_template = string.Template("""
IFMAP_SERVER=$__contrail_ifmap_srv_ip__
IFMAP_PORT=$__contrail_ifmap_srv_port__
IFMAP_USER=$__contrail_ifmap_usr__
IFMAP_PASWD=$__contrail_ifmap_paswd__
COLLECTOR=$__contrail_collector__
COLLECTOR_PORT=$__contrail_collector_port__
DISCOVERY=$__contrail_discovery_ip__
HOSTIP=$__contrail_host_ip__
CERT_OPTS=$__contrail_cert_ops__
DNS_LOGFILE=$__contrail_logfile__
LOG_LOCAL=$__contrail_log_local__
""")
discovery_conf_template = string.Template("""
[DEFAULTS]
zk_server_ip=127.0.0.1
zk_server_port=$__contrail_zk_server_port__
listen_ip_addr=$__contrail_listen_ip_addr__
listen_port=$__contrail_listen_port__
log_local=$__contrail_log_local__
log_file=$__contrail_log_file__
# minimim time to allow client to cache service information (seconds)
ttl_min=300
# maximum time to allow client to cache service information (seconds)
ttl_max=1800
# maximum hearbeats to miss before server will declare publisher out of
# service.
hc_max_miss=3
# use short TTL for agressive rescheduling if all services are not up
ttl_short=1
######################################################################
# Other service specific knobs ...
# use short TTL for agressive rescheduling if all services are not up
# ttl_short=1
# specify policy to use when assigning services
# policy = [load-balance | round-robin | fixed]
######################################################################
""")
contrail_collector_conf_template = string.Template("""
CASSANDRA_SERVER_LIST=$__contrail_cassandra_server_list__
REDIS_SERVER=$__contrail_redis_server__
REDIS_SERVER_PORT=$__contrail_redis_server_port__
DISCOVERY=$__contrail_discovery_ip__
HOST_IP=$__contrail_host_ip__
LISTEN_PORT=$__contrail_listen_port__
HTTP_SERVER_PORT=$__contrail_http_server_port__
LOG_FILE=$__contrail_log_file__
LOG_LOCAL=$__contrail_log_local__
LOG_LEVEL=$__contrail_log_level__
""")
contrail_query_conf_template = string.Template("""
CASSANDRA_SERVER_LIST=$__contrail_cassandra_server_list__
REDIS_SERVER=$__contrail_redis_server__
REDIS_SERVER_PORT=$__contrail_redis_server_port__
DISCOVERY=$__contrail_discovery_ip__
HOST_IP=$__contrail_host_ip__
LISTEN_PORT=$__contrail_listen_port__
HTTP_SERVER_PORT=$__contrail_http_server_port__
LOG_FILE=$__contrail_log_file__
LOG_LOCAL=$__contrail_log_local__
LOG_LEVEL=$__contrail_log_level__
""")
contrail_analytics_api_template = string.Template("""
REDIS_SERVER=$__contrail_redis_server__
REDIS_SERVER_PORT=$__contrail_redis_server_port__
REDIS_QUERY_PORT=$__contrail_redis_query_port__
COLLECTOR=$__contrail_collector__
COLLECTOR_PORT=$__contrail_collector_port__
HTTP_SERVER_PORT=$__contrail_http_server_port__
REST_API_PORT=$__contrail_rest_api_port__
LOG_FILE=$__contrail_log_file__
LOG_LOCAL=$__contrail_log_local__
LOG_LEVEL=$__contrail_log_level__
DISCOVERY=$__contrail_discovery_ip__
""")
vnc_api_lib_ini_template = string.Template("""
[global]
;WEB_SERVER = 127.0.0.1
;WEB_PORT = 9696 ; connection through quantum plugin
WEB_SERVER = 127.0.0.1
WEB_PORT = 8082 ; connection to api-server directly
BASE_URL = /
;BASE_URL = /tenants/infra ; common-prefix for all URLs
; Authentication settings (optional)
[auth]
AUTHN_TYPE = keystone
AUTHN_SERVER=$__contrail_openstack_ip__
AUTHN_PORT = 35357
AUTHN_URL = /v2.0/tokens
""")
agent_param_template = string.Template("""
LOG=/var/log/contrail.log
CONFIG=/etc/contrail/agent.conf
prog=/usr/bin/vnswad
kmod=vrouter/vrouter.ko
pname=vnswad
LIBDIR=/usr/lib64
VHOST_CFG=/etc/sysconfig/network-scripts/ifcfg-vhost0
VROUTER_LOGFILE=--log-file=/var/log/vrouter.log
COLLECTOR=$__contrail_collector__
$__contrail_dev__
""")
agent_conf_template = string.Template("""
<?xml version="1.0" encoding="utf-8"?>
<config>
<agent>
<!-- Physical ports connecting to IP Fabric -->
<vhost>
<name>vhost0</name>
<ip-address>$__contrail_box_ip__</ip-address>
<gateway>$__contrail_gateway__</gateway>
</vhost>
<eth-port>
<name>$__contrail_intf__</name>
</eth-port>
<control>
<ip-address>$__contrail_box_ip__</ip-address>
</control>
<xmpp-server>
<ip-address>$__contrail_control_ip__</ip-address>
</xmpp-server>
</agent>
</config>
""")
agent_vgw_conf_template = string.Template("""
<?xml version="1.0" encoding="utf-8"?>
<config>
<agent>
<!-- Physical ports connecting to IP Fabric -->
<vhost>
<name>vhost0</name>
<ip-address>$__contrail_box_ip__</ip-address>
<gateway>$__contrail_gateway__</gateway>
</vhost>
<eth-port>
<name>$__contrail_intf__</name>
</eth-port>
<control>
<ip-address>$__contrail_control_ip__</ip-address>
</control>
<xmpp-server>
<ip-address>$__contrail_control_ip__</ip-address>
</xmpp-server>
<gateway virtual-network="$__contrail_vgw_public_network__">
<interface>$__contrail_vgw_interface__</interface>
<subnet>$__contrail_vgw_public_subnet__</subnet>
</gateway>
</agent>
</config>
""")
ifconfig_vhost0_template = string.Template("""
#Contrail vhost0
DEVICE=vhost0
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=yes
IPADDR=$__contrail_ipaddr__
NETMASK=$__contrail_netmask__
NM_CONTROLLED=no
#NETWORK MANAGER BUG WORKAROUND
SUBCHANNELS=1,2,3
$__contrail_gateway__
$__contrail_dns__
$__contrail_domain__
$__contrail_mtu__
""")
contrail_plugin_template = string.Template("""
[APISERVER]
api_server_ip=$__api_server_ip__
api_server_port=$__api_server_port__
multi_tenancy=$__multitenancy__
[KEYSTONE]
admin_user=$__contrail_admin_user__
admin_password=$__contrail_admin_password__
admin_tenant_name=$__contrail_admin_tenant_name__
""")
openstackrc_template = string.Template("""
export OS_USERNAME=$__contrail_admin_user__
export OS_PASSWORD=$__contrail_admin_password__
export OS_TENANT_NAME=$__contrail_admin_tenant_name__
export OS_AUTH_URL=http://$__contrail_keystone_ip__:5000/v2.0/
export OS_NO_CACHE=1
""")