authentication fails by keystonemiddleware
In order to pass througth the authentication of keystonemiddleware, I add a function "create_smaug_accounts" to create an account in Keystone in the plugin.sh. There are 4 steps in "create_smaug_accounts" : 1. create a user "smaug". 2. bind the user with the project "service" and grant the role "service" to the user. 3. create a service "smaug". 4. create an endpoint. Change-Id: I7644e568a8912f48e54b15cf897afe67a81c2e4a Closes-Bug: #1526638
This commit is contained in:
parent
bda35bb321
commit
0c01e63cb0
@ -16,6 +16,29 @@ function _create_smaug_conf_dir {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# create_smaug_accounts() - Set up common required smaug accounts
|
||||||
|
|
||||||
|
# Tenant User Roles
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# service smaug service
|
||||||
|
|
||||||
|
function create_smaug_accounts {
|
||||||
|
|
||||||
|
if is_service_enabled smaug-api; then
|
||||||
|
|
||||||
|
create_service_user "smaug"
|
||||||
|
|
||||||
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
|
||||||
|
get_or_create_service "smaug" "protect" "Disaster Recovery Service"
|
||||||
|
get_or_create_endpoint "protect" "$REGION_NAME" \
|
||||||
|
"$SMAUG_API_PROTOCOL://$SMAUG_API_HOST:$SMAUG_API_PORT/v1/\$(tenant_id)s" \
|
||||||
|
"$SMAUG_API_PROTOCOL://$SMAUG_API_HOST:$SMAUG_API_PORT/v1/\$(tenant_id)s" \
|
||||||
|
"$SMAUG_API_PROTOCOL://$SMAUG_API_HOST:$SMAUG_API_PORT/v1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function configure_smaug_api {
|
function configure_smaug_api {
|
||||||
if is_service_enabled smaug-api ; then
|
if is_service_enabled smaug-api ; then
|
||||||
echo "Configuring Smaug API"
|
echo "Configuring Smaug API"
|
||||||
@ -75,6 +98,9 @@ if [[ "$Q_ENABLE_SMAUG" == "True" ]]; then
|
|||||||
echo export PYTHONPATH=\$PYTHONPATH:$SMAUG_DIR >> $RC_DIR/.localrc.auto
|
echo export PYTHONPATH=\$PYTHONPATH:$SMAUG_DIR >> $RC_DIR/.localrc.auto
|
||||||
|
|
||||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||||
|
|
||||||
|
create_smaug_accounts
|
||||||
|
|
||||||
echo_summary "Initializing Smaug Service"
|
echo_summary "Initializing Smaug Service"
|
||||||
SMAUG_BIN_DIR=$(get_python_exec_prefix)
|
SMAUG_BIN_DIR=$(get_python_exec_prefix)
|
||||||
if is_service_enabled smaug-api; then
|
if is_service_enabled smaug-api; then
|
||||||
|
@ -12,7 +12,7 @@ SMAUG_API_CONF=$SMAUG_CONF_DIR/smaug.conf
|
|||||||
|
|
||||||
SMAUG_API_LISTEN_ADDRESS=${SMAUG_API_LISTEN_ADDRESS:-0.0.0.0}
|
SMAUG_API_LISTEN_ADDRESS=${SMAUG_API_LISTEN_ADDRESS:-0.0.0.0}
|
||||||
SMAUG_API_HOST=${SMAUG_API_HOST:-$SERVICE_HOST}
|
SMAUG_API_HOST=${SMAUG_API_HOST:-$SERVICE_HOST}
|
||||||
SMAUG_API_PORT=${SMAUG_API_PORT:-19999}
|
SMAUG_API_PORT=${SMAUG_API_PORT:-8799}
|
||||||
SMAUG_API_PROTOCOL=${SMAUG_API_PROTOCOL:-$SERVICE_PROTOCOL}
|
SMAUG_API_PROTOCOL=${SMAUG_API_PROTOCOL:-$SERVICE_PROTOCOL}
|
||||||
|
|
||||||
SMAUG_AUTH_CACHE_DIR=${SMAUG_AUTH_CACHE_DIR:-/var/cache/smaug}
|
SMAUG_AUTH_CACHE_DIR=${SMAUG_AUTH_CACHE_DIR:-/var/cache/smaug}
|
||||||
|
Loading…
Reference in New Issue
Block a user