blob: 9aad8f39ae8d46dfad1a6bcee65980f9764b8c0e [file] [log] [blame]
Mark McClainb05c8762013-07-06 23:29:39 -04001# Neutron Linux Bridge plugin
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09002# ---------------------------
3
4# Save trace setting
Dean Troyer8d55be32013-02-07 17:16:35 -06005MY_XTRACE=$(set +o | grep xtrace)
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09006set +o xtrace
7
Mark McClainb05c8762013-07-06 23:29:39 -04008function neutron_plugin_configure_common() {
9 Q_PLUGIN_CONF_PATH=etc/neutron/plugins/linuxbridge
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090010 Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini
Mark McClainb05c8762013-07-06 23:29:39 -040011 Q_DB_NAME="neutron_linux_bridge"
12 Q_PLUGIN_CLASS="neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2"
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090013}
14
Mark McClainb05c8762013-07-06 23:29:39 -040015function neutron_plugin_configure_service() {
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090016 if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000017 iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090018 else
19 echo "WARNING - The linuxbridge plugin is using local tenant networks, with no connectivity between hosts."
20 fi
21
22 # Override ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc``
23 # for more complex physical network configurations.
24 if [[ "$LB_VLAN_RANGES" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]]; then
25 LB_VLAN_RANGES=$PHYSICAL_NETWORK
26 if [[ "$TENANT_VLAN_RANGE" != "" ]]; then
27 LB_VLAN_RANGES=$LB_VLAN_RANGES:$TENANT_VLAN_RANGE
28 fi
29 fi
30 if [[ "$LB_VLAN_RANGES" != "" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000031 iniset /$Q_PLUGIN_CONF_FILE vlans network_vlan_ranges $LB_VLAN_RANGES
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090032 fi
Jiajun Liue6f2ee52013-05-14 09:48:15 +000033 if [[ "$Q_USE_SECGROUP" == "True" ]]; then
Mark McClainb05c8762013-07-06 23:29:39 -040034 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
Jiajun Liue6f2ee52013-05-14 09:48:15 +000035 else
Mark McClainb05c8762013-07-06 23:29:39 -040036 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
Jiajun Liue6f2ee52013-05-14 09:48:15 +000037 fi
Kyle Mesteryebfac642013-05-17 15:20:56 -050038
39 # Define extra "LINUX_BRIDGE" configuration options when q-svc is configured by defining
40 # the array ``Q_SRV_EXTRA_OPTS``.
41 # For Example: ``Q_SRV_EXTRA_OPTS=(foo=true bar=2)``
42 for I in "${Q_SRV_EXTRA_OPTS[@]}"; do
43 # Replace the first '=' with ' ' for iniset syntax
Gary Kottond42634f2013-06-24 09:26:55 +000044 iniset /$Q_PLUGIN_CONF_FILE linux_bridge ${I/=/ }
Kyle Mesteryebfac642013-05-17 15:20:56 -050045 done
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090046}
47
Mark McClainb05c8762013-07-06 23:29:39 -040048function has_neutron_plugin_security_group() {
Akihiro MOTOKI3452f8e2013-03-21 14:11:27 +090049 # 0 means True here
50 return 0
51}
52
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090053# Restore xtrace
Dean Troyer8d55be32013-02-07 17:16:35 -060054$MY_XTRACE