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
diff --git a/lib/horizon b/lib/horizon
index 27c2d26..4688109 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -45,7 +45,10 @@
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 @@
_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