Merge "Users in service group should not have email addresses"
This commit is contained in:
commit
1ecd43da54
@ -723,8 +723,13 @@ function policy_add {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Gets or creates user
|
# Gets or creates user
|
||||||
# Usage: get_or_create_user <username> <password> <project> <email>
|
# Usage: get_or_create_user <username> <password> <project> [<email>]
|
||||||
function get_or_create_user {
|
function get_or_create_user {
|
||||||
|
if [[ ! -z "$4" ]]; then
|
||||||
|
local EMAIL="--email=$4"
|
||||||
|
else
|
||||||
|
local EMAIL=""
|
||||||
|
fi
|
||||||
# Gets user id
|
# Gets user id
|
||||||
USER_ID=$(
|
USER_ID=$(
|
||||||
# Gets user id
|
# Gets user id
|
||||||
@ -734,7 +739,7 @@ function get_or_create_user {
|
|||||||
$1 \
|
$1 \
|
||||||
--password "$2" \
|
--password "$2" \
|
||||||
--project $3 \
|
--project $3 \
|
||||||
--email $4 \
|
$EMAIL \
|
||||||
-f value -c id
|
-f value -c id
|
||||||
)
|
)
|
||||||
echo $USER_ID
|
echo $USER_ID
|
||||||
|
@ -85,7 +85,7 @@ create_ceilometer_accounts() {
|
|||||||
# Ceilometer
|
# Ceilometer
|
||||||
if [[ "$ENABLED_SERVICES" =~ "ceilometer-api" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "ceilometer-api" ]]; then
|
||||||
CEILOMETER_USER=$(get_or_create_user "ceilometer" \
|
CEILOMETER_USER=$(get_or_create_user "ceilometer" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "ceilometer@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $CEILOMETER_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $CEILOMETER_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
@ -323,7 +323,7 @@ function create_cinder_accounts {
|
|||||||
if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
|
||||||
|
|
||||||
CINDER_USER=$(get_or_create_user "cinder" \
|
CINDER_USER=$(get_or_create_user "cinder" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "cinder@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $CINDER_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $CINDER_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
@ -166,7 +166,7 @@ function create_glance_accounts {
|
|||||||
if is_service_enabled g-api; then
|
if is_service_enabled g-api; then
|
||||||
|
|
||||||
GLANCE_USER=$(get_or_create_user "glance" \
|
GLANCE_USER=$(get_or_create_user "glance" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT_NAME "glance@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT_NAME)
|
||||||
get_or_add_user_role service $GLANCE_USER $SERVICE_TENANT_NAME
|
get_or_add_user_role service $GLANCE_USER $SERVICE_TENANT_NAME
|
||||||
|
|
||||||
# required for swift access
|
# required for swift access
|
||||||
|
2
lib/heat
2
lib/heat
@ -217,7 +217,7 @@ function create_heat_accounts {
|
|||||||
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||||
|
|
||||||
HEAT_USER=$(get_or_create_user "heat" \
|
HEAT_USER=$(get_or_create_user "heat" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "heat@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $HEAT_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $HEAT_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
@ -221,7 +221,7 @@ function create_ironic_accounts {
|
|||||||
# Get ironic user if exists
|
# Get ironic user if exists
|
||||||
|
|
||||||
IRONIC_USER=$(get_or_create_user "ironic" \
|
IRONIC_USER=$(get_or_create_user "ironic" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "ironic@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $IRONIC_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $IRONIC_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
@ -330,7 +330,7 @@ function create_keystone_accounts {
|
|||||||
# admin
|
# admin
|
||||||
ADMIN_TENANT=$(get_or_create_project "admin")
|
ADMIN_TENANT=$(get_or_create_project "admin")
|
||||||
ADMIN_USER=$(get_or_create_user "admin" \
|
ADMIN_USER=$(get_or_create_user "admin" \
|
||||||
"$ADMIN_PASSWORD" "$ADMIN_TENANT" "admin@example.com")
|
"$ADMIN_PASSWORD" "$ADMIN_TENANT")
|
||||||
ADMIN_ROLE=$(get_or_create_role "admin")
|
ADMIN_ROLE=$(get_or_create_role "admin")
|
||||||
get_or_add_user_role $ADMIN_ROLE $ADMIN_USER $ADMIN_TENANT
|
get_or_add_user_role $ADMIN_ROLE $ADMIN_USER $ADMIN_TENANT
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ function create_marconi_accounts {
|
|||||||
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||||
|
|
||||||
MARCONI_USER=$(get_or_create_user "marconi" \
|
MARCONI_USER=$(get_or_create_user "marconi" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "marconi@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $MARCONI_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $MARCONI_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
@ -362,7 +362,7 @@ function create_neutron_accounts {
|
|||||||
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
|
||||||
|
|
||||||
NEUTRON_USER=$(get_or_create_user "neutron" \
|
NEUTRON_USER=$(get_or_create_user "neutron" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "neutron@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $NEUTRON_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $NEUTRON_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
2
lib/nova
2
lib/nova
@ -335,7 +335,7 @@ create_nova_accounts() {
|
|||||||
if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
|
||||||
|
|
||||||
NOVA_USER=$(get_or_create_user "nova" \
|
NOVA_USER=$(get_or_create_user "nova" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "nova@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $NOVA_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $NOVA_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
@ -61,7 +61,7 @@ function create_sahara_accounts {
|
|||||||
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||||
|
|
||||||
SAHARA_USER=$(get_or_create_user "sahara" \
|
SAHARA_USER=$(get_or_create_user "sahara" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "sahara@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $SAHARA_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $SAHARA_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
@ -550,7 +550,7 @@ function create_swift_accounts {
|
|||||||
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||||
|
|
||||||
SWIFT_USER=$(get_or_create_user "swift" \
|
SWIFT_USER=$(get_or_create_user "swift" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "swift@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $ADMIN_ROLE $SWIFT_USER $SERVICE_TENANT
|
get_or_add_user_role $ADMIN_ROLE $SWIFT_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
@ -83,7 +83,7 @@ function create_trove_accounts {
|
|||||||
if [[ "$ENABLED_SERVICES" =~ "trove" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "trove" ]]; then
|
||||||
|
|
||||||
TROVE_USER=$(get_or_create_user "trove" \
|
TROVE_USER=$(get_or_create_user "trove" \
|
||||||
"$SERVICE_PASSWORD" $SERVICE_TENANT "trove@example.com")
|
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||||
get_or_add_user_role $SERVICE_ROLE $TROVE_USER $SERVICE_TENANT
|
get_or_add_user_role $SERVICE_ROLE $TROVE_USER $SERVICE_TENANT
|
||||||
|
|
||||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user