blob: 362fd5b39e3428b931c583212d50f2469eeb0438 [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
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_DB_NAME="neutron_linux_bridge"
14 Q_PLUGIN_CLASS="neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2"
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090015}
16
Ian Wienandaee18c72014-02-21 15:35:08 +110017function neutron_plugin_configure_service {
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090018 if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000019 iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090020 else
21 echo "WARNING - The linuxbridge plugin is using local tenant networks, with no connectivity between hosts."
22 fi
23
24 # Override ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc``
25 # for more complex physical network configurations.
26 if [[ "$LB_VLAN_RANGES" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]]; then
27 LB_VLAN_RANGES=$PHYSICAL_NETWORK
28 if [[ "$TENANT_VLAN_RANGE" != "" ]]; then
29 LB_VLAN_RANGES=$LB_VLAN_RANGES:$TENANT_VLAN_RANGE
30 fi
31 fi
32 if [[ "$LB_VLAN_RANGES" != "" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000033 iniset /$Q_PLUGIN_CONF_FILE vlans network_vlan_ranges $LB_VLAN_RANGES
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090034 fi
Jiajun Liue6f2ee52013-05-14 09:48:15 +000035 if [[ "$Q_USE_SECGROUP" == "True" ]]; then
Mark McClainb05c8762013-07-06 23:29:39 -040036 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
Jiajun Liue6f2ee52013-05-14 09:48:15 +000037 else
Mark McClainb05c8762013-07-06 23:29:39 -040038 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
Jiajun Liue6f2ee52013-05-14 09:48:15 +000039 fi
Kyle Mesteryebfac642013-05-17 15:20:56 -050040
41 # Define extra "LINUX_BRIDGE" configuration options when q-svc is configured by defining
42 # the array ``Q_SRV_EXTRA_OPTS``.
43 # For Example: ``Q_SRV_EXTRA_OPTS=(foo=true bar=2)``
44 for I in "${Q_SRV_EXTRA_OPTS[@]}"; do
45 # Replace the first '=' with ' ' for iniset syntax
Gary Kottond42634f2013-06-24 09:26:55 +000046 iniset /$Q_PLUGIN_CONF_FILE linux_bridge ${I/=/ }
Kyle Mesteryebfac642013-05-17 15:20:56 -050047 done
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090048}
49
Ian Wienandaee18c72014-02-21 15:35:08 +110050function has_neutron_plugin_security_group {
Akihiro MOTOKI3452f8e2013-03-21 14:11:27 +090051 # 0 means True here
52 return 0
53}
54
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090055# Restore xtrace
Dean Troyer8d55be32013-02-07 17:16:35 -060056$MY_XTRACE