blob: 87e7aaaf360372e8bc545ddbac52195b876eb3de [file] [log] [blame]
Eugene Nikanorovb7d82842013-03-06 16:28:33 +04001# Quantum loadbalancer plugin
2# ---------------------------
3
4# Save trace setting
5MY_XTRACE=$(set +o | grep xtrace)
6set +o xtrace
7
8
9AGENT_LBAAS_BINARY="$QUANTUM_DIR/bin/quantum-lbaas-agent"
10
11function quantum_agent_lbaas_install_agent_packages() {
12 if is_ubuntu || is_fedora; then
13 install_package haproxy
Vincent Untz3f34d9a2013-03-12 17:57:36 +010014 elif is_suse; then
15 ### FIXME: Find out if package can be pushed to Factory
16 echo "HAProxy packages can be installed from server:http project in OBS"
Eugene Nikanorovb7d82842013-03-06 16:28:33 +040017 fi
18}
19
20function quantum_agent_lbaas_configure_common() {
21 if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then
22 Q_SERVICE_PLUGIN_CLASSES="quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin"
23 else
24 Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin"
25 fi
26}
27
28function quantum_agent_lbaas_configure_agent() {
29 LBAAS_AGENT_CONF_PATH=/etc/quantum/plugins/services/agent_loadbalancer
30 mkdir -p $LBAAS_AGENT_CONF_PATH
31
32 LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini"
33
34 cp $QUANTUM_DIR/etc/lbaas_agent.ini /$LBAAS_AGENT_CONF_FILENAME
35
36 if [[ $Q_PLUGIN == 'linuxbridge' || $Q_PLUGIN == 'brocade' ]]; then
37 iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT interface_driver "quantum.agent.linux.interface.BridgeInterfaceDriver"
38 else
39 iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT interface_driver "quantum.agent.linux.interface.OVSInterfaceDriver"
40 fi
41
42 if is_fedora; then
43 iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT user_group "nobody"
44 fi
45}
46
47# Restore xtrace
48$MY_XTRACE