Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 1 | # Neutron loadbalancer plugin |
Eugene Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 2 | # --------------------------- |
| 3 | |
| 4 | # Save trace setting |
| 5 | MY_XTRACE=$(set +o | grep xtrace) |
| 6 | set +o xtrace |
| 7 | |
| 8 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 9 | AGENT_LBAAS_BINARY="$NEUTRON_BIN_DIR/neutron-lbaas-agent" |
| 10 | LBAAS_PLUGIN=neutron.services.loadbalancer.plugin.LoadBalancerPlugin |
Eugene Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 11 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 12 | function neutron_agent_lbaas_install_agent_packages() { |
Eugene Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 13 | if is_ubuntu || is_fedora; then |
| 14 | install_package haproxy |
Vincent Untz | 3f34d9a | 2013-03-12 17:57:36 +0100 | [diff] [blame] | 15 | 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 Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 18 | fi |
| 19 | } |
| 20 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 21 | function neutron_agent_lbaas_configure_common() { |
Isaku Yamahata | 9e136b4 | 2013-12-16 15:52:03 +0900 | [diff] [blame^] | 22 | _neutron_service_plugin_class_add $LBAAS_PLUGIN |
Eugene Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 23 | } |
| 24 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 25 | function neutron_agent_lbaas_configure_agent() { |
| 26 | LBAAS_AGENT_CONF_PATH=/etc/neutron/services/loadbalancer/haproxy |
Eugene Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 27 | mkdir -p $LBAAS_AGENT_CONF_PATH |
| 28 | |
| 29 | LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini" |
| 30 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 31 | cp $NEUTRON_DIR/etc/lbaas_agent.ini $LBAAS_AGENT_CONF_FILENAME |
Eugene Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 32 | |
Maru Newby | d7150e9 | 2013-04-23 06:16:11 +0000 | [diff] [blame] | 33 | # 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 McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 37 | neutron_plugin_setup_interface_driver $LBAAS_AGENT_CONF_FILENAME |
Eugene Nikanorov | b7d8284 | 2013-03-06 16:28:33 +0400 | [diff] [blame] | 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 |