Configure Horizon to use SSL-enabled Keystone

SSL can be enabled in Keystone when devstack is executed.
Horizon was not being configured to use the SSL port so
authentication was failing.

Change-Id: I253766d359aaab0bd1f844a8a637adc77e8eee2b
Closes-Bug: 1293749
This commit is contained in:
Rob Crittenden 2014-03-17 00:07:52 -04:00
parent 473add7e0b
commit c31fa40b77

View File

@ -45,7 +45,10 @@ function _horizon_config_set {
local option=$3 local option=$3
local value=$4 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) line=$(sed -ne "/^$section/,/^}/ { /^ *'$option':/ p; }" $file)
if [ -n "$line" ]; then if [ -n "$line" ]; then
sed -i -e "/^$section/,/^}/ s/^\( *'$option'\) *:.*$/\1: $value,/" $file 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 _horizon_config_set $local_settings OPENSTACK_NEUTRON_NETWORK enable_vpn True
fi 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 # Create an empty directory that apache uses as docroot
sudo mkdir -p $HORIZON_DIR/.blackhole sudo mkdir -p $HORIZON_DIR/.blackhole