blob: 5f989ae0adb5ec521414cf863eacea4cd77eeb31 [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 Troyere3a91602014-03-28 12:40:56 -05005LBRIDGE_XTRACE=$(set +o | grep xtrace)
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09006set +o xtrace
7
Mehdi Abaakouk28147812013-06-29 14:17:16 +02008source $TOP_DIR/lib/neutron_plugins/linuxbridge_agent
9
Ian Wienandaee18c72014-02-21 15:35:08 +110010function neutron_plugin_configure_common {
Mark McClainb05c8762013-07-06 23:29:39 -040011 Q_PLUGIN_CONF_PATH=etc/neutron/plugins/linuxbridge
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090012 Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini
Mark McClainb05c8762013-07-06 23:29:39 -040013 Q_PLUGIN_CLASS="neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2"
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090014}
15
Ian Wienandaee18c72014-02-21 15:35:08 +110016function neutron_plugin_configure_service {
Kyle Mesterybd085502014-04-30 23:50:29 +000017 if [[ "$ENABLE_TENANT_VLANS" == "True" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000018 iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090019 else
20 echo "WARNING - The linuxbridge plugin is using local tenant networks, with no connectivity between hosts."
21 fi
22
23 # Override ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc``
24 # for more complex physical network configurations.
Kyle Mesterybd085502014-04-30 23:50:29 +000025 if [[ "$LB_VLAN_RANGES" == "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]]; then
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090026 LB_VLAN_RANGES=$PHYSICAL_NETWORK
27 if [[ "$TENANT_VLAN_RANGE" != "" ]]; then
28 LB_VLAN_RANGES=$LB_VLAN_RANGES:$TENANT_VLAN_RANGE
29 fi
30 fi
31 if [[ "$LB_VLAN_RANGES" != "" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000032 iniset /$Q_PLUGIN_CONF_FILE vlans network_vlan_ranges $LB_VLAN_RANGES
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090033 fi
Jiajun Liue6f2ee52013-05-14 09:48:15 +000034 if [[ "$Q_USE_SECGROUP" == "True" ]]; then
Mark McClainb05c8762013-07-06 23:29:39 -040035 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
Jiajun Liue6f2ee52013-05-14 09:48:15 +000036 else
Mark McClainb05c8762013-07-06 23:29:39 -040037 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
Jiajun Liue6f2ee52013-05-14 09:48:15 +000038 fi
Kyle Mesteryebfac642013-05-17 15:20:56 -050039
40 # Define extra "LINUX_BRIDGE" configuration options when q-svc is configured by defining
41 # the array ``Q_SRV_EXTRA_OPTS``.
42 # For Example: ``Q_SRV_EXTRA_OPTS=(foo=true bar=2)``
43 for I in "${Q_SRV_EXTRA_OPTS[@]}"; do
44 # Replace the first '=' with ' ' for iniset syntax
Gary Kottond42634f2013-06-24 09:26:55 +000045 iniset /$Q_PLUGIN_CONF_FILE linux_bridge ${I/=/ }
Kyle Mesteryebfac642013-05-17 15:20:56 -050046 done
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090047}
48
Ian Wienandaee18c72014-02-21 15:35:08 +110049function has_neutron_plugin_security_group {
Akihiro MOTOKI3452f8e2013-03-21 14:11:27 +090050 # 0 means True here
51 return 0
52}
53
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090054# Restore xtrace
Dean Troyere3a91602014-03-28 12:40:56 -050055$LBRIDGE_XTRACE