From c31fa40b77d47e456005718b473570a3d52e76e5 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 17 Mar 2014 00:07:52 -0400 Subject: [PATCH] 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 --- lib/horizon | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/horizon b/lib/horizon index 27c2d26a01..4688109bd4 100644 --- a/lib/horizon +++ b/lib/horizon @@ -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