| ... | ... |
@@ -137,7 +137,7 @@ OS\_AUTH\_URL |
| 137 | 137 |
|
| 138 | 138 |
:: |
| 139 | 139 |
|
| 140 |
- OS_AUTH_URL=http://$SERVICE_HOST/identity/v3.0 |
|
| 140 |
+ OS_AUTH_URL=http://$SERVICE_HOST:5000/v3.0 |
|
| 141 | 141 |
|
| 142 | 142 |
KEYSTONECLIENT\_DEBUG, NOVACLIENT\_DEBUG |
| 143 | 143 |
Set command-line client log level to ``DEBUG``. These are commented |
| ... | ... |
@@ -685,6 +685,16 @@ KEYSTONE_REGION_NAME to specify the region of Keystone service. |
| 685 | 685 |
KEYSTONE_REGION_NAME has a default value the same as REGION_NAME thus we omit |
| 686 | 686 |
it in the configuration of RegionOne. |
| 687 | 687 |
|
| 688 |
+Disabling Identity API v2 |
|
| 689 |
+ |
|
| 690 |
+The Identity API v2 is deprecated as of Mitaka and it is recommended to only |
|
| 691 |
+use the v3 API. It is possible to setup keystone without v2 API, by doing: |
|
| 692 |
+ |
|
| 693 |
+:: |
|
| 694 |
+ |
|
| 695 |
+ ENABLE_IDENTITY_V2=False |
|
| 696 |
+ |
|
| 688 | 697 |
.. _arch-configuration: |
| 689 | 698 |
|
| 690 | 699 |
Architectures |
| ... | ... |
@@ -1,9 +1,39 @@ |
| 1 |
+Listen %PUBLICPORT% |
|
| 2 |
+Listen %ADMINPORT% |
|
| 1 | 3 |
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D(us)" keystone_combined
|
| 2 | 4 |
|
| 3 | 5 |
<Directory %KEYSTONE_BIN%> |
| 4 | 6 |
Require all granted |
| 5 | 7 |
</Directory> |
| 6 | 8 |
|
| 9 |
+<VirtualHost *:%PUBLICPORT%> |
|
| 10 |
+ WSGIDaemonProcess keystone-public processes=3 threads=1 user=%USER% display-name=%{GROUP} %VIRTUALENV%
|
|
| 11 |
+ WSGIProcessGroup keystone-public |
|
| 12 |
+ WSGIScriptAlias / %KEYSTONE_BIN%/keystone-wsgi-public |
|
| 13 |
+ WSGIApplicationGroup %{GLOBAL}
|
|
| 14 |
+ WSGIPassAuthorization On |
|
| 15 |
+ ErrorLogFormat "%M" |
|
| 16 |
+ ErrorLog /var/log/%APACHE_NAME%/keystone.log |
|
| 17 |
+ CustomLog /var/log/%APACHE_NAME%/keystone_access.log keystone_combined |
|
| 18 |
+ %SSLENGINE% |
|
| 19 |
+ %SSLCERTFILE% |
|
| 20 |
+ %SSLKEYFILE% |
|
| 21 |
+</VirtualHost> |
|
| 22 |
+ |
|
| 23 |
+<VirtualHost *:%ADMINPORT%> |
|
| 24 |
+ WSGIDaemonProcess keystone-admin processes=3 threads=1 user=%USER% display-name=%{GROUP} %VIRTUALENV%
|
|
| 25 |
+ WSGIProcessGroup keystone-admin |
|
| 26 |
+ WSGIScriptAlias / %KEYSTONE_BIN%/keystone-wsgi-admin |
|
| 27 |
+ WSGIApplicationGroup %{GLOBAL}
|
|
| 28 |
+ WSGIPassAuthorization On |
|
| 29 |
+ ErrorLogFormat "%M" |
|
| 30 |
+ ErrorLog /var/log/%APACHE_NAME%/keystone.log |
|
| 31 |
+ CustomLog /var/log/%APACHE_NAME%/keystone_access.log keystone_combined |
|
| 32 |
+ %SSLENGINE% |
|
| 33 |
+ %SSLCERTFILE% |
|
| 34 |
+ %SSLKEYFILE% |
|
| 35 |
+</VirtualHost> |
|
| 36 |
+ |
|
| 7 | 37 |
%SSLLISTEN%<VirtualHost *:443> |
| 8 | 38 |
%SSLLISTEN% %SSLENGINE% |
| 9 | 39 |
%SSLLISTEN% %SSLCERTFILE% |
| ... | ... |
@@ -83,10 +83,14 @@ KEYSTONE_TOKEN_FORMAT=$(echo ${KEYSTONE_TOKEN_FORMAT} | tr '[:upper:]' '[:lower:
|
| 83 | 83 |
|
| 84 | 84 |
# Set Keystone interface configuration |
| 85 | 85 |
KEYSTONE_AUTH_HOST=${KEYSTONE_AUTH_HOST:-$SERVICE_HOST}
|
| 86 |
+KEYSTONE_AUTH_PORT=${KEYSTONE_AUTH_PORT:-35357}
|
|
| 87 |
+KEYSTONE_AUTH_PORT_INT=${KEYSTONE_AUTH_PORT_INT:-35358}
|
|
| 86 | 88 |
KEYSTONE_AUTH_PROTOCOL=${KEYSTONE_AUTH_PROTOCOL:-$SERVICE_PROTOCOL}
|
| 87 | 89 |
|
| 88 | 90 |
# Public facing bits |
| 89 | 91 |
KEYSTONE_SERVICE_HOST=${KEYSTONE_SERVICE_HOST:-$SERVICE_HOST}
|
| 92 |
+KEYSTONE_SERVICE_PORT=${KEYSTONE_SERVICE_PORT:-5000}
|
|
| 93 |
+KEYSTONE_SERVICE_PORT_INT=${KEYSTONE_SERVICE_PORT_INT:-5001}
|
|
| 90 | 94 |
KEYSTONE_SERVICE_PROTOCOL=${KEYSTONE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
|
| 91 | 95 |
|
| 92 | 96 |
# Bind hosts |
| ... | ... |
@@ -166,14 +170,22 @@ function _config_keystone_apache_wsgi {
|
| 166 | 166 |
local keystone_ssl="" |
| 167 | 167 |
local keystone_certfile="" |
| 168 | 168 |
local keystone_keyfile="" |
| 169 |
+ local keystone_service_port=$KEYSTONE_SERVICE_PORT |
|
| 170 |
+ local keystone_auth_port=$KEYSTONE_AUTH_PORT |
|
| 169 | 171 |
local venv_path="" |
| 170 | 172 |
|
| 173 |
+ if is_service_enabled tls-proxy; then |
|
| 174 |
+ keystone_service_port=$KEYSTONE_SERVICE_PORT_INT |
|
| 175 |
+ keystone_auth_port=$KEYSTONE_AUTH_PORT_INT |
|
| 176 |
+ fi |
|
| 171 | 177 |
if [[ ${USE_VENV} = True ]]; then
|
| 172 | 178 |
venv_path="python-path=${PROJECT_VENV["keystone"]}/lib/$(python_version)/site-packages"
|
| 173 | 179 |
fi |
| 174 | 180 |
|
| 175 | 181 |
sudo cp $FILES/apache-keystone.template $keystone_apache_conf |
| 176 | 182 |
sudo sed -e " |
| 183 |
+ s|%PUBLICPORT%|$keystone_service_port|g; |
|
| 184 |
+ s|%ADMINPORT%|$keystone_auth_port|g; |
|
| 177 | 185 |
s|%APACHE_NAME%|$APACHE_NAME|g; |
| 178 | 186 |
s|%SSLLISTEN%|$keystone_ssl_listen|g; |
| 179 | 187 |
s|%SSLENGINE%|$keystone_ssl|g; |
| ... | ... |
@@ -210,8 +222,21 @@ function configure_keystone {
|
| 210 | 210 |
|
| 211 | 211 |
iniset_rpc_backend keystone $KEYSTONE_CONF oslo_messaging_notifications |
| 212 | 212 |
|
| 213 |
+ local service_port=$KEYSTONE_SERVICE_PORT |
|
| 214 |
+ local auth_port=$KEYSTONE_AUTH_PORT |
|
| 215 |
+ |
|
| 216 |
+ if is_service_enabled tls-proxy; then |
|
| 217 |
+ # Set the service ports for a proxy to take the originals |
|
| 218 |
+ service_port=$KEYSTONE_SERVICE_PORT_INT |
|
| 219 |
+ auth_port=$KEYSTONE_AUTH_PORT_INT |
|
| 220 |
+ fi |
|
| 221 |
+ |
|
| 213 | 222 |
# Override the endpoints advertised by keystone (the public_endpoint and |
| 214 |
- # admin_endpoint) so that clients use the correct endpoint. |
|
| 223 |
+ # admin_endpoint) so that clients use the correct endpoint. By default, the |
|
| 224 |
+ # keystone server uses the public_port and admin_port which isn't going to |
|
| 225 |
+ # work when you want to use a different port (in the case of proxy), or you |
|
| 226 |
+ # don't want the port (in the case of putting keystone on a path in |
|
| 227 |
+ # apache). |
|
| 215 | 228 |
iniset $KEYSTONE_CONF DEFAULT public_endpoint $KEYSTONE_SERVICE_URI |
| 216 | 229 |
iniset $KEYSTONE_CONF DEFAULT admin_endpoint $KEYSTONE_AUTH_URI |
| 217 | 230 |
|
| ... | ... |
@@ -245,6 +270,12 @@ function configure_keystone {
|
| 245 | 245 |
|
| 246 | 246 |
iniset $KEYSTONE_CONF credential key_repository "$KEYSTONE_CONF_DIR/credential-keys/" |
| 247 | 247 |
|
| 248 |
+ # Configure the project created by the 'keystone-manage bootstrap' as the cloud-admin project. |
|
| 249 |
+ # The users from this project are globally admin as before, but it also |
|
| 250 |
+ # allows policy changes in order to clarify the adminess scope. |
|
| 251 |
+ #iniset $KEYSTONE_CONF resource admin_project_domain_name Default |
|
| 252 |
+ #iniset $KEYSTONE_CONF resource admin_project_name admin |
|
| 253 |
+ |
|
| 248 | 254 |
if [[ "$KEYSTONE_SECURITY_COMPLIANCE_ENABLED" = True ]]; then |
| 249 | 255 |
iniset $KEYSTONE_CONF security_compliance lockout_failure_attempts $KEYSTONE_LOCKOUT_FAILURE_ATTEMPTS |
| 250 | 256 |
iniset $KEYSTONE_CONF security_compliance lockout_duration $KEYSTONE_LOCKOUT_DURATION |
| ... | ... |
@@ -479,6 +510,14 @@ function install_keystone {
|
| 479 | 479 |
|
| 480 | 480 |
# start_keystone() - Start running processes |
| 481 | 481 |
function start_keystone {
|
| 482 |
+ # Get right service port for testing |
|
| 483 |
+ local service_port=$KEYSTONE_SERVICE_PORT |
|
| 484 |
+ local auth_protocol=$KEYSTONE_AUTH_PROTOCOL |
|
| 485 |
+ if is_service_enabled tls-proxy; then |
|
| 486 |
+ service_port=$KEYSTONE_SERVICE_PORT_INT |
|
| 487 |
+ auth_protocol="http" |
|
| 488 |
+ fi |
|
| 489 |
+ |
|
| 482 | 490 |
if [ "$KEYSTONE_DEPLOY" == "mod_wsgi" ]; then |
| 483 | 491 |
enable_apache_site keystone |
| 484 | 492 |
restart_apache_server |
| ... | ... |
@@ -487,13 +526,23 @@ function start_keystone {
|
| 487 | 487 |
fi |
| 488 | 488 |
|
| 489 | 489 |
echo "Waiting for keystone to start..." |
| 490 |
- # Check that the keystone service is running. |
|
| 490 |
+ # Check that the keystone service is running. Even if the tls tunnel |
|
| 491 |
+ # should be enabled, make sure the internal port is checked using |
|
| 492 |
+ # unencryted traffic at this point. |
|
| 493 |
+ # If running in Apache, use the path rather than port. |
|
| 494 |
+ |
|
| 491 | 495 |
local service_uri=$auth_protocol://$KEYSTONE_SERVICE_HOST/identity/v$IDENTITY_API_VERSION/ |
| 492 | 496 |
|
| 493 | 497 |
if ! wait_for_service $SERVICE_TIMEOUT $service_uri; then |
| 494 | 498 |
die $LINENO "keystone did not start" |
| 495 | 499 |
fi |
| 496 | 500 |
|
| 501 |
+ # Start proxies if enabled |
|
| 502 |
+ if is_service_enabled tls-proxy; then |
|
| 503 |
+ start_tls_proxy keystone-service '*' $KEYSTONE_SERVICE_PORT $KEYSTONE_SERVICE_HOST $KEYSTONE_SERVICE_PORT_INT |
|
| 504 |
+ start_tls_proxy keystone-auth '*' $KEYSTONE_AUTH_PORT $KEYSTONE_AUTH_HOST $KEYSTONE_AUTH_PORT_INT |
|
| 505 |
+ fi |
|
| 506 |
+ |
|
| 497 | 507 |
# (re)start memcached to make sure we have a clean memcache. |
| 498 | 508 |
restart_service memcached |
| 499 | 509 |
} |
| ... | ... |
@@ -512,9 +561,11 @@ function stop_keystone {
|
| 512 | 512 |
# This function uses the following GLOBAL variables: |
| 513 | 513 |
# - ``KEYSTONE_BIN_DIR`` |
| 514 | 514 |
# - ``ADMIN_PASSWORD`` |
| 515 |
-# - ``KEYSTONE_AUTH_URI`` |
|
| 515 |
+# - ``IDENTITY_API_VERSION`` |
|
| 516 | 516 |
# - ``REGION_NAME`` |
| 517 |
-# - ``KEYSTONE_SERVICE_URI`` |
|
| 517 |
+# - ``KEYSTONE_SERVICE_PROTOCOL`` |
|
| 518 |
+# - ``KEYSTONE_SERVICE_HOST`` |
|
| 519 |
+# - ``KEYSTONE_SERVICE_PORT`` |
|
| 518 | 520 |
function bootstrap_keystone {
|
| 519 | 521 |
$KEYSTONE_BIN_DIR/keystone-manage bootstrap \ |
| 520 | 522 |
--bootstrap-username admin \ |
| ... | ... |
@@ -86,7 +86,7 @@ export OS_AUTH_TYPE=password |
| 86 | 86 |
# |
| 87 | 87 |
|
| 88 | 88 |
# If you don't have a working .stackenv, this is the backup position |
| 89 |
-KEYSTONE_BACKUP=$SERVICE_PROTOCOL://$SERVICE_HOST/identity |
|
| 89 |
+KEYSTONE_BACKUP=$SERVICE_PROTOCOL://$SERVICE_HOST:5000 |
|
| 90 | 90 |
KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_URI:-$KEYSTONE_BACKUP}
|
| 91 | 91 |
|
| 92 | 92 |
export OS_AUTH_URL=${OS_AUTH_URL:-$KEYSTONE_SERVICE_URI}
|
| ... | ... |
@@ -152,7 +152,7 @@ if [ -z "$OS_USERNAME" ]; then |
| 152 | 152 |
fi |
| 153 | 153 |
|
| 154 | 154 |
if [ -z "$OS_AUTH_URL" ]; then |
| 155 |
- export OS_AUTH_URL=http://localhost/identity/v3/ |
|
| 155 |
+ export OS_AUTH_URL=http://localhost:5000/v3/ |
|
| 156 | 156 |
fi |
| 157 | 157 |
|
| 158 | 158 |
if [ -z "$OS_USER_DOMAIN_ID" -a -z "$OS_USER_DOMAIN_NAME" ]; then |
| ... | ... |
@@ -26,6 +26,39 @@ if [[ -z "$TOP_DIR" ]]; then |
| 26 | 26 |
FILES=$TOP_DIR/files |
| 27 | 27 |
fi |
| 28 | 28 |
|
| 29 |
+# Keystone Port Reservation |
|
| 30 |
+# ------------------------- |
|
| 31 |
+# Reserve and prevent ``KEYSTONE_AUTH_PORT`` and ``KEYSTONE_AUTH_PORT_INT`` from |
|
| 32 |
+# being used as ephemeral ports by the system. The default(s) are 35357 and |
|
| 33 |
+# 35358 which are in the Linux defined ephemeral port range (in disagreement |
|
| 34 |
+# with the IANA ephemeral port range). This is a workaround for bug #1253482 |
|
| 35 |
+# where Keystone will try and bind to the port and the port will already be |
|
| 36 |
+# in use as an ephemeral port by another process. This places an explicit |
|
| 37 |
+# exception into the Kernel for the Keystone AUTH ports. |
|
| 38 |
+function fixup_keystone {
|
|
| 39 |
+ keystone_ports=${KEYSTONE_AUTH_PORT:-35357},${KEYSTONE_AUTH_PORT_INT:-35358}
|
|
| 40 |
+ |
|
| 41 |
+ # Only do the reserved ports when available, on some system (like containers) |
|
| 42 |
+ # where it's not exposed we are almost pretty sure these ports would be |
|
| 43 |
+ # exclusive for our DevStack. |
|
| 44 |
+ if sysctl net.ipv4.ip_local_reserved_ports >/dev/null 2>&1; then |
|
| 45 |
+ # Get any currently reserved ports, strip off leading whitespace |
|
| 46 |
+ reserved_ports=$(sysctl net.ipv4.ip_local_reserved_ports | awk -F'=' '{print $2;}' | sed 's/^ //')
|
|
| 47 |
+ |
|
| 48 |
+ if [[ -z "${reserved_ports}" ]]; then
|
|
| 49 |
+ # If there are no currently reserved ports, reserve the keystone ports |
|
| 50 |
+ sudo sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_ports}
|
|
| 51 |
+ else |
|
| 52 |
+ # If there are currently reserved ports, keep those and also reserve the |
|
| 53 |
+ # Keystone specific ports. Duplicate reservations are merged into a single |
|
| 54 |
+ # reservation (or range) automatically by the kernel. |
|
| 55 |
+ sudo sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_ports},${reserved_ports}
|
|
| 56 |
+ fi |
|
| 57 |
+ else |
|
| 58 |
+ echo_summary "WARNING: unable to reserve keystone ports" |
|
| 59 |
+ fi |
|
| 60 |
+} |
|
| 61 |
+ |
|
| 29 | 62 |
# Ubuntu Repositories |
| 30 | 63 |
#-------------------- |
| 31 | 64 |
# Enable universe for bionic since it is missing when installing from ISO. |
| ... | ... |
@@ -175,6 +208,7 @@ function fixup_suse {
|
| 175 | 175 |
} |
| 176 | 176 |
|
| 177 | 177 |
function fixup_all {
|
| 178 |
+ fixup_keystone |
|
| 178 | 179 |
fixup_ubuntu |
| 179 | 180 |
fixup_fedora |
| 180 | 181 |
fixup_suse |