Devstack support for Neutron VPNaaS

Includes two enhancements to support VPNaaS and allow other
vendor implementation support. Goal is to provide a solution
for VPN .ini files until a more general solution can be defined
to handle all reference and vendor .ini files.

First, the /opt/stack/neutron/etc/vpn_agent.ini file is copied
to /etc/neutron, to allow the selected device drivers for agent
to be specified. Both reference and vendor implementations can
be uncommented in this file, prior to stacking.

Second, to allow vendor VPN implementations to provide an .ini
file to the agent at start-up time, an environment variable is
defined and can be set in the localrc to specify one or more
.ini files. The desire is NOT to include vendor settings in the
global vpn_agent.ini.

Change-Id: Ia8250db660216a5296cb6ba2af1538b8c90d187c
Closes-Bug: 1301552
This commit is contained in:
Paul Michali
2014-04-02 19:12:22 +00:00
parent 4b49e37240
commit 746dceeb68

View File

@@ -127,6 +127,10 @@ Q_L3_ROUTER_PER_TENANT=${Q_L3_ROUTER_PER_TENANT:-False}
# See _configure_neutron_common() for details about setting it up
declare -a Q_PLUGIN_EXTRA_CONF_FILES
# List of (optional) config files for VPN device drivers to use with
# the neutron-q-vpn agent
declare -a Q_VPN_EXTRA_CONF_FILES
Q_RR_CONF_FILE=$NEUTRON_CONF_DIR/rootwrap.conf
if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
@@ -495,7 +499,7 @@ function start_neutron_agents {
L3_CONF_FILES="$L3_CONF_FILES --config-file $Q_FWAAS_CONF_FILE"
fi
if is_service_enabled q-vpn; then
screen_it q-vpn "cd $NEUTRON_DIR && $AGENT_VPN_BINARY $L3_CONF_FILES"
screen_it q-vpn "cd $NEUTRON_DIR && $AGENT_VPN_BINARY $VPN_CONF_FILES"
else
screen_it q-l3 "cd $NEUTRON_DIR && python $AGENT_L3_BINARY $L3_CONF_FILES"
fi
@@ -658,6 +662,7 @@ function _configure_neutron_dhcp_agent {
}
function _configure_neutron_l3_agent {
local cfg_file
Q_L3_ENABLED=True
# for l3-agent, only use per tenant router if we have namespaces
Q_L3_ROUTER_PER_TENANT=$Q_USE_NAMESPACE
@@ -669,6 +674,15 @@ function _configure_neutron_l3_agent {
Q_FWAAS_CONF_FILE=$NEUTRON_CONF_DIR/fwaas_driver.ini
fi
if is_service_enabled q-vpn; then
Q_VPN_CONF_FILE=$NEUTRON_CONF_DIR/vpn_agent.ini
cp $NEUTRON_DIR/etc/vpn_agent.ini $Q_VPN_CONF_FILE
VPN_CONF_FILES="--config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE --config-file=$Q_VPN_CONF_FILE"
for cfg_file in ${Q_VPN_EXTRA_CONF_FILES[@]}; do
VPN_CONF_FILES+=" --config-file $cfg_file"
done
fi
cp $NEUTRON_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE
iniset $Q_L3_CONF_FILE DEFAULT verbose True