devstack/lib/neutron_plugins/services/loadbalancer
Martin Hickey 10bff0e996 Neutron LBaaS: Use generated configuration files if available
Generate the Neutron LBaaS sample config files by using the oslo
generator. The files are generated with a .sample extension and
replace the static example configuration files.

Once the generation code is delivered, the static config files
will be removed.

Change-Id: Iae1e581ec2bea9c0ced700229effcc716d53fe4e
Related-blueprint: autogen-neutron-conf-file
Partial-bug: #1199963
Depends-On: I25507f3bc6e995580aa91a912c2cf4110757df15
2015-12-10 16:55:07 +00:00

52 lines
1.5 KiB
Bash

#!/bin/bash
# Neutron loadbalancer plugin
# ---------------------------
# Save trace setting
_XTRACE_NEUTRON_LB=$(set +o | grep xtrace)
set +o xtrace
AGENT_LBAAS_BINARY="$NEUTRON_BIN_DIR/neutron-lbaas-agent"
LBAAS_PLUGIN=neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPlugin
function neutron_agent_lbaas_install_agent_packages {
if is_ubuntu || is_fedora || is_suse; then
install_package haproxy
fi
}
function neutron_agent_lbaas_configure_common {
_neutron_service_plugin_class_add $LBAAS_PLUGIN
_neutron_deploy_rootwrap_filters $NEUTRON_LBAAS_DIR
}
function neutron_agent_lbaas_configure_agent {
LBAAS_AGENT_CONF_PATH=/etc/neutron/services/loadbalancer/haproxy
mkdir -p $LBAAS_AGENT_CONF_PATH
LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini"
cp $NEUTRON_LBAAS_DIR/etc/lbaas_agent.ini.sample $LBAAS_AGENT_CONF_FILENAME
# ovs_use_veth needs to be set before the plugin configuration
# occurs to allow plugins to override the setting.
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT ovs_use_veth $Q_OVS_USE_VETH
neutron_plugin_setup_interface_driver $LBAAS_AGENT_CONF_FILENAME
if is_fedora; then
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT user_group "nobody"
iniset $LBAAS_AGENT_CONF_FILENAME haproxy user_group "nobody"
fi
}
function neutron_lbaas_stop {
pids=$(ps aux | awk '/haproxy/ { print $2 }')
[ ! -z "$pids" ] && sudo kill $pids || true
}
# Restore xtrace
$_XTRACE_NEUTRON_LB