Update Devstack plugin for uwsgi and mod_proxy_uwsgi

[0] switched keystone to use uwsgi and mod_proxy_uwsgi by default
instead of mod_wsgi breaking the Devstack plugin which assumed
the latter. This commit fixes the Devstack plugin to work with
both and therefore fixes the functional v3 only gates which
are currently broken.

[0]. I46294fb24e3c23fa19fcfd7d6c9ee8a932354702

Change-Id: Iaffb3f18fd0f1444a6b6067d63474c27eb1bd13d
This commit is contained in:
Kristi Nikolla 2017-04-20 17:42:31 -04:00
parent c7ab7c5677
commit b8555843bf
1 changed files with 23 additions and 11 deletions

View File

@ -28,6 +28,28 @@ MAPPING_USER_NAME=${MAPPING_USER_NAME:-"{0}"}
PROTOCOL_ID=${PROTOCOL_ID:-mapped} PROTOCOL_ID=${PROTOCOL_ID:-mapped}
function configure_apache {
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
local keystone_apache_conf=$(apache_site_config_for keystone-wsgi-public)
echo "ProxyPass /Shibboleth.sso !" | sudo tee -a $keystone_apache_conf
else
local keystone_apache_conf=$(apache_site_config_for keystone)
# Add WSGIScriptAlias directive to vhost configuration for port 5000
sudo sed -i -e "
/<VirtualHost \*:5000>/r $KEYSTONE_PLUGIN/files/federation/shib_apache_alias.txt
" $keystone_apache_conf
fi
# Append to the keystone.conf vhost file a <Location> directive for the Shibboleth module
# and a <Location> directive for the identity provider
cat $KEYSTONE_PLUGIN/files/federation/shib_apache_handler.txt | sudo tee -a $keystone_apache_conf
sudo sed -i -e "s|%IDP_ID%|$IDP_ID|g;" $keystone_apache_conf
}
function install_federation { function install_federation {
if is_ubuntu; then if is_ubuntu; then
install_package libapache2-mod-shib2 install_package libapache2-mod-shib2
@ -58,17 +80,7 @@ function upload_sp_metadata {
} }
function configure_federation { function configure_federation {
local keystone_apache_conf=$(apache_site_config_for keystone) configure_apache
# Add WSGIScriptAlias directive to vhost configuration for port 5000
sudo sed -i -e "
/<VirtualHost \*:5000>/r $KEYSTONE_PLUGIN/files/federation/shib_apache_alias.txt
" $keystone_apache_conf
# Append to the keystone.conf vhost file a <Location> directive for the Shibboleth module
# and a <Location> directive for the identity provider
cat $KEYSTONE_PLUGIN/files/federation/shib_apache_handler.txt | sudo tee -a $keystone_apache_conf
sudo sed -i -e "s|%IDP_ID%|$IDP_ID|g;" $keystone_apache_conf
# Copy a templated /etc/shibboleth/shibboleth2.xml file... # Copy a templated /etc/shibboleth/shibboleth2.xml file...
sudo cp $KEYSTONE_PLUGIN/files/federation/shibboleth2.xml /etc/shibboleth/shibboleth2.xml sudo cp $KEYSTONE_PLUGIN/files/federation/shibboleth2.xml /etc/shibboleth/shibboleth2.xml