Skip to content

Commit ccd116d

Browse files
committed
Cinder: add creator role when barbican is enabled
When barbican is enabled, add the "creator" role to cinder's service user so that cinder can create secrets. Cinder needs to create barbican secrets when migrating encryption keys from the legacy ConfKeyManager to barbican. Cinder also needs to create barbican secrets in order to support transferring encrypted volumes. Implements: bp/transfer-encrypted-volume Depends-On: I216f78e8a300ab3f79bbcbb38110adf2bbec2196 Change-Id: Ia3f414c4b9b0829f60841a6dd63c97a893fdde4d
1 parent 28ee346 commit ccd116d

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

lib/cinder

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,24 @@ function configure_cinder {
388388

389389
# create_cinder_accounts() - Set up common required cinder accounts
390390

391-
# Tenant User Roles
391+
# Project User Roles
392392
# ------------------------------------------------------------------
393-
# service cinder admin # if enabled
393+
# SERVICE_PROJECT_NAME cinder service
394+
# SERVICE_PROJECT_NAME cinder creator (if Barbican is enabled)
394395

395396
# Migrated from keystone_data.sh
396397
function create_cinder_accounts {
397398
# Cinder
398399
if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
399400

400-
create_service_user "cinder"
401+
local extra_role=""
402+
403+
# cinder needs the "creator" role in order to interact with barbican
404+
if is_service_enabled barbican; then
405+
extra_role=$(get_or_create_role "creator")
406+
fi
407+
408+
create_service_user "cinder" $extra_role
401409

402410
# block-storage is the official service type
403411
get_or_create_service "cinder" "block-storage" "Cinder Volume Service"

0 commit comments

Comments
 (0)