Merge "Configure Horizon to use SSL-enabled Keystone"

This commit is contained in:
Jenkins 2014-05-02 12:12:02 +00:00 committed by Gerrit Code Review
commit 584e65cfc1

View File

@ -45,7 +45,10 @@ function _horizon_config_set {
local option=$3
local value=$4
if grep -q "^$section" $file; then
if [ -z "$section" ]; then
sed -e "/^$option/d" -i $local_settings
echo -e "\n$option=$value" >> $file
elif grep -q "^$section" $file; then
line=$(sed -ne "/^$section/,/^}/ { /^ *'$option':/ p; }" $file)
if [ -n "$line" ]; then
sed -i -e "/^$section/,/^}/ s/^\( *'$option'\) *:.*$/\1: $value,/" $file
@ -103,6 +106,13 @@ function init_horizon {
_horizon_config_set $local_settings OPENSTACK_NEUTRON_NETWORK enable_vpn True
fi
_horizon_config_set $local_settings "" OPENSTACK_HOST \"${KEYSTONE_SERVICE_HOST}\"
_horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_PROTOCOL}://%s:${KEYSTONE_SERVICE_PORT}/v2.0\" % OPENSTACK_HOST"
if [ -f $SSL_BUNDLE_FILE ]; then
_horizon_config_set $local_settings "" OPENSTACK_SSL_CACERT \"${SSL_BUNDLE_FILE}\"
fi
# Create an empty directory that apache uses as docroot
sudo mkdir -p $HORIZON_DIR/.blackhole