Skip to content

Commit f5998b0

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Use path-mounted keystone when running in httpd"
2 parents 730703a + 841fdaf commit f5998b0

2 files changed

Lines changed: 28 additions & 7 deletions

File tree

files/apache-keystone.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Alias /identity %KEYSTONE_BIN%/keystone-wsgi-public
4444
WSGIPassAuthorization On
4545
</Location>
4646

47-
Alias /identity_admin %KEYSTONE_BIN%/keystone-wsgi-admin
48-
<Location /identity_admin>
47+
Alias /identity_v2_admin %KEYSTONE_BIN%/keystone-wsgi-admin
48+
<Location /identity_v2_admin>
4949
SetHandler wsgi-script
5050
Options +ExecCGI
5151

lib/keystone

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,14 @@ if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
122122
fi
123123

124124
# complete URIs
125-
KEYSTONE_AUTH_URI=${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_AUTH_HOST}:${KEYSTONE_AUTH_PORT}
126-
KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}
125+
if [ "$KEYSTONE_DEPLOY" == "mod_wsgi" ]; then
126+
# If running in Apache, use path access rather than port.
127+
KEYSTONE_AUTH_URI=${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_AUTH_HOST}/identity_v2_admin
128+
KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}/identity
129+
else
130+
KEYSTONE_AUTH_URI=${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_AUTH_HOST}:${KEYSTONE_AUTH_PORT}
131+
KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}
132+
fi
127133

128134
# V3 URIs
129135
KEYSTONE_AUTH_URI_V3=$KEYSTONE_AUTH_URI/v3
@@ -259,7 +265,15 @@ function configure_keystone {
259265
# Set the service ports for a proxy to take the originals
260266
service_port=$KEYSTONE_SERVICE_PORT_INT
261267
auth_port=$KEYSTONE_AUTH_PORT_INT
268+
fi
262269

270+
# Override the endpoints advertised by keystone (the public_endpoint and
271+
# admin_endpoint) so that clients use the correct endpoint. By default, the
272+
# keystone server uses the public_port and admin_port which isn't going to
273+
# work when you want to use a different port (in the case of proxy), or you
274+
# don't want the port (in the case of putting keystone on a path in
275+
# apache).
276+
if is_service_enabled tls-proxy || [ "$KEYSTONE_DEPLOY" == "mod_wsgi" ]; then
263277
iniset $KEYSTONE_CONF DEFAULT public_endpoint $KEYSTONE_SERVICE_URI
264278
iniset $KEYSTONE_CONF DEFAULT admin_endpoint $KEYSTONE_AUTH_URI
265279
fi
@@ -582,7 +596,14 @@ function start_keystone {
582596
# Check that the keystone service is running. Even if the tls tunnel
583597
# should be enabled, make sure the internal port is checked using
584598
# unencryted traffic at this point.
585-
if ! wait_for_service $SERVICE_TIMEOUT $auth_protocol://$KEYSTONE_SERVICE_HOST:$service_port/v$IDENTITY_API_VERSION/; then
599+
# If running in Apache, use the path rather than port.
600+
601+
local service_uri=$auth_protocol://$KEYSTONE_SERVICE_HOST:$service_port/v$IDENTITY_API_VERSION/
602+
if [ "$KEYSTONE_DEPLOY" == "mod_wsgi" ]; then
603+
service_uri=$auth_protocol://$KEYSTONE_SERVICE_HOST/identity/v$IDENTITY_API_VERSION/
604+
fi
605+
606+
if ! wait_for_service $SERVICE_TIMEOUT $service_uri; then
586607
die $LINENO "keystone did not start"
587608
fi
588609

@@ -625,8 +646,8 @@ function bootstrap_keystone {
625646
--bootstrap-service-name keystone \
626647
--bootstrap-region-id "$REGION_NAME" \
627648
--bootstrap-admin-url "$KEYSTONE_AUTH_URI" \
628-
--bootstrap-public-url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT" \
629-
--bootstrap-internal-url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT"
649+
--bootstrap-public-url "$KEYSTONE_SERVICE_URI" \
650+
--bootstrap-internal-url "$KEYSTONE_SERVICE_URI"
630651
}
631652

632653
# Restore xtrace

0 commit comments

Comments
 (0)