Eugene Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 1 | # Quantum loadbalancer plugin |
| 2 | # --------------------------- |
| 3 | |
| 4 | # Save trace setting |
| 5 | MY_XTRACE=$(set +o | grep xtrace) |
| 6 | set +o xtrace |
| 7 | |
| 8 | |
| 9 | AGENT_LBAAS_BINARY="$QUANTUM_DIR/bin/quantum-lbaas-agent" |
| 10 | |
| 11 | function quantum_agent_lbaas_install_agent_packages() { |
| 12 | if is_ubuntu || is_fedora; then |
| 13 | install_package haproxy |
Vincent Untz | 3f34d9a | 2013-03-12 17:57:36 +0100 | [diff] [blame^] | 14 | 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 Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 17 | fi |
| 18 | } |
| 19 | |
| 20 | function 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 | |
| 28 | function 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 |