blob: a4d6dff024c79b46b1635f40d466c7bcd2acfc93 [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
14 fi
15}
16
17function quantum_agent_lbaas_configure_common() {
18 if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then
19 Q_SERVICE_PLUGIN_CLASSES="quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin"
20 else
21 Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin"
22 fi
23}
24
25function quantum_agent_lbaas_configure_agent() {
26 LBAAS_AGENT_CONF_PATH=/etc/quantum/plugins/services/agent_loadbalancer
27 mkdir -p $LBAAS_AGENT_CONF_PATH
28
29 LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini"
30
31 cp $QUANTUM_DIR/etc/lbaas_agent.ini /$LBAAS_AGENT_CONF_FILENAME
32
33 if [[ $Q_PLUGIN == 'linuxbridge' || $Q_PLUGIN == 'brocade' ]]; then
34 iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT interface_driver "quantum.agent.linux.interface.BridgeInterfaceDriver"
35 else
36 iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT interface_driver "quantum.agent.linux.interface.OVSInterfaceDriver"
37 fi
38
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