Files
training-labs/labs/osbash/scripts/ubuntu/setup_lbaas_controller.sh
Pranav Salunke 1f3b5005ed Adds Liberty support
Adding Liberty support to training-labs. This port has a few major
changes primarily due to changes in install guides.

  * Uses newer network configuration.
  * Updates architecture from three nodes to two nodes.
  * Changes OVS to linuxbridge

Co-Authored-By: Bernd <berndbausch@gmail.com>
Co-Authored-By: Roger Luethi <rl@patchworkscience.org>

Change-Id: I5a71383459412ce56cff62ba86db8c58d3d4b84e
2016-01-31 19:47:27 +00:00

63 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
set -o errexit -o nounset
TOP_DIR=$(cd "$(dirname "$0")/.." && pwd)
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/credentials"
source "$LIB_DIR/functions.guest.sh"
source "$CONFIG_DIR/admin-openstackrc.sh"
exec_logfile
indicate_current_auto
#------------------------------------------------------------------------------
# Set up OpenStack neutron LBaaS for controller node.
# http://docs.openstack.org/admin-guide-cloud/content/install_neutron-lbaas-agent.html
#------------------------------------------------------------------------------
echo "Configuring neutron lbaas for controller node."
conf=/etc/neutron/neutron.conf
# Configure network plugin parameters
# FIXME The following line breaks neutron
iniset_sudo $conf DEFAULT service_plugins "router,lbaas"
echo "Restarting neutron service."
sudo service neutron-server restart
# Configure openstack dashboard
function check_dashboard_settings {
local memcached_conf=/etc/memcached.conf
local dashboard_conf=/etc/openstack-dashboard/local_settings.py
# Enabling Neutron LBaaS on Horizon
echo "Enabling neutron LBaaS on horizon."
sudo sed -i "s/'enable_lb': False/\'enable_lb\': True/" $dashboard_conf
}
echo "Checking dashboard configuration."
check_dashboard_settings
function check_apache_service {
# Check if apache service is down, if not force retry a couple of times.
sleep 10
i=0
until service apache2 status | grep 'not running'; do
sudo service apache2 stop
sleep 10
i=$((i + 1))
if [ $i -gt 3 ]; then
break
fi
done
}
echo "Reloading apache and memcached service."
sudo service apache2 stop
check_apache_service
sudo service apache2 start
sudo service memcached restart