blob: c9ea1cac280e75e1d41d765de5f88961b92f2f9a [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
mathieu-rohon50187ee2014-11-21 22:12:40 +01003# Neutron Linux Bridge L2 agent
4# -----------------------------
5
6# Save trace setting
7PLUGIN_XTRACE=$(set +o | grep xtrace)
8set +o xtrace
9
10function is_neutron_ovs_base_plugin {
11 # linuxbridge doesn't use OVS
12 return 1
13}
14
15function neutron_plugin_create_nova_conf {
16 :
17}
18
19function neutron_plugin_install_agent_packages {
20 install_package bridge-utils
21}
22
23function neutron_plugin_configure_debug_command {
24 iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT external_network_bridge
25}
26
27function neutron_plugin_configure_dhcp_agent {
28 iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
29}
30
31function neutron_plugin_configure_l3_agent {
32 iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
33 iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
34}
35
36function neutron_plugin_configure_plugin_agent {
37 # Setup physical network interface mappings. Override
38 # ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc`` for more
39 # complex physical network configurations.
40 if [[ "$LB_INTERFACE_MAPPINGS" == "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]] && [[ "$LB_PHYSICAL_INTERFACE" != "" ]]; then
41 LB_INTERFACE_MAPPINGS=$PHYSICAL_NETWORK:$LB_PHYSICAL_INTERFACE
42 fi
43 if [[ "$LB_INTERFACE_MAPPINGS" != "" ]]; then
44 iniset /$Q_PLUGIN_CONF_FILE linux_bridge physical_interface_mappings $LB_INTERFACE_MAPPINGS
45 fi
46 if [[ "$Q_USE_SECGROUP" == "True" ]]; then
47 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
48 else
49 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
50 fi
51 AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-linuxbridge-agent"
52 iniset /$Q_PLUGIN_CONF_FILE agent tunnel_types $Q_TUNNEL_TYPES
mathieu-rohon50187ee2014-11-21 22:12:40 +010053}
54
55function neutron_plugin_setup_interface_driver {
56 local conf_file=$1
57 iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
58}
59
60function neutron_plugin_check_adv_test_requirements {
61 is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
62}
63
64# Restore xtrace
65$PLUGIN_XTRACE