Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 1 | # Neutron Linux Bridge plugin |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 2 | # --------------------------- |
| 3 | |
| 4 | # Save trace setting |
Dean Troyer | 8d55be3 | 2013-02-07 17:16:35 -0600 | [diff] [blame] | 5 | MY_XTRACE=$(set +o | grep xtrace) |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 6 | set +o xtrace |
| 7 | |
Mehdi Abaakouk | 2814781 | 2013-06-29 14:17:16 +0200 | [diff] [blame] | 8 | source $TOP_DIR/lib/neutron_plugins/linuxbridge_agent |
| 9 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 10 | function neutron_plugin_configure_common { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 11 | Q_PLUGIN_CONF_PATH=etc/neutron/plugins/linuxbridge |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 12 | Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 13 | Q_DB_NAME="neutron_linux_bridge" |
| 14 | Q_PLUGIN_CLASS="neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2" |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 15 | } |
| 16 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 17 | function neutron_plugin_configure_service { |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 18 | if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then |
Gary Kotton | d42634f | 2013-06-24 09:26:55 +0000 | [diff] [blame] | 19 | iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 20 | 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 Kotton | d42634f | 2013-06-24 09:26:55 +0000 | [diff] [blame] | 33 | iniset /$Q_PLUGIN_CONF_FILE vlans network_vlan_ranges $LB_VLAN_RANGES |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 34 | fi |
Jiajun Liu | e6f2ee5 | 2013-05-14 09:48:15 +0000 | [diff] [blame] | 35 | if [[ "$Q_USE_SECGROUP" == "True" ]]; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 36 | iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver |
Jiajun Liu | e6f2ee5 | 2013-05-14 09:48:15 +0000 | [diff] [blame] | 37 | else |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 38 | iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver |
Jiajun Liu | e6f2ee5 | 2013-05-14 09:48:15 +0000 | [diff] [blame] | 39 | fi |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 40 | |
| 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 Kotton | d42634f | 2013-06-24 09:26:55 +0000 | [diff] [blame] | 46 | iniset /$Q_PLUGIN_CONF_FILE linux_bridge ${I/=/ } |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 47 | done |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 48 | } |
| 49 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 50 | function has_neutron_plugin_security_group { |
Akihiro MOTOKI | 3452f8e | 2013-03-21 14:11:27 +0900 | [diff] [blame] | 51 | # 0 means True here |
| 52 | return 0 |
| 53 | } |
| 54 | |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 55 | # Restore xtrace |
Dean Troyer | 8d55be3 | 2013-02-07 17:16:35 -0600 | [diff] [blame] | 56 | $MY_XTRACE |