blob: 6ff991c8555d13c8ff4ce545f74fc4c275baf38a [file] [log] [blame]
Mark McClainb05c8762013-07-06 23:29:39 -04001# Neutron loadbalancer plugin
Eugene Nikanorovb7d82842013-03-06 16:28:33 +04002# ---------------------------
3
4# Save trace setting
5MY_XTRACE=$(set +o | grep xtrace)
6set +o xtrace
7
8
Mark McClainb05c8762013-07-06 23:29:39 -04009AGENT_LBAAS_BINARY="$NEUTRON_BIN_DIR/neutron-lbaas-agent"
10LBAAS_PLUGIN=neutron.services.loadbalancer.plugin.LoadBalancerPlugin
Eugene Nikanorovb7d82842013-03-06 16:28:33 +040011
Mark McClainb05c8762013-07-06 23:29:39 -040012function neutron_agent_lbaas_install_agent_packages() {
Eugene Nikanorovb7d82842013-03-06 16:28:33 +040013 if is_ubuntu || is_fedora; then
14 install_package haproxy
Vincent Untz3f34d9a2013-03-12 17:57:36 +010015 elif is_suse; then
16 ### FIXME: Find out if package can be pushed to Factory
17 echo "HAProxy packages can be installed from server:http project in OBS"
Eugene Nikanorovb7d82842013-03-06 16:28:33 +040018 fi
19}
20
Mark McClainb05c8762013-07-06 23:29:39 -040021function neutron_agent_lbaas_configure_common() {
Isaku Yamahata9e136b42013-12-16 15:52:03 +090022 _neutron_service_plugin_class_add $LBAAS_PLUGIN
Eugene Nikanorovb7d82842013-03-06 16:28:33 +040023}
24
Mark McClainb05c8762013-07-06 23:29:39 -040025function neutron_agent_lbaas_configure_agent() {
26 LBAAS_AGENT_CONF_PATH=/etc/neutron/services/loadbalancer/haproxy
Eugene Nikanorovb7d82842013-03-06 16:28:33 +040027 mkdir -p $LBAAS_AGENT_CONF_PATH
28
29 LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini"
30
Mark McClainb05c8762013-07-06 23:29:39 -040031 cp $NEUTRON_DIR/etc/lbaas_agent.ini $LBAAS_AGENT_CONF_FILENAME
Eugene Nikanorovb7d82842013-03-06 16:28:33 +040032
Maru Newbyd7150e92013-04-23 06:16:11 +000033 # ovs_use_veth needs to be set before the plugin configuration
34 # occurs to allow plugins to override the setting.
35 iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT ovs_use_veth $Q_OVS_USE_VETH
36
Mark McClainb05c8762013-07-06 23:29:39 -040037 neutron_plugin_setup_interface_driver $LBAAS_AGENT_CONF_FILENAME
Eugene Nikanorovb7d82842013-03-06 16:28:33 +040038
39 if is_fedora; then
40 iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT user_group "nobody"
41 fi
42}
43
44# Restore xtrace
45$MY_XTRACE