diff options
-rwxr-xr-x | add-user-roles | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/add-user-roles b/add-user-roles index 7a72b1f..5c1633c 100755 --- a/add-user-roles +++ b/add-user-roles @@ -2,20 +2,18 @@ # add user with project-admin role to all projects -#ROLEID=$(keystone role-list | grep -i projectadmin | awk '{print $2}') +ROLEID=$(keystone role-list | grep -i projectadmin | awk '{print $2}') USERID=NULL declare -a PROJECTS=('playground' 'bitmask testing' LEAP 'Bitmask clientdev' 'Bitmask development' 'Bitmask production'); -for project in ${PROJECTS[@]} +for (( i = 0; i < ${#PROJECTS[@]}; i++ )) do - PROJECTID=$(keystone tenant-list | grep -i $project | awk '{print $2}') + PROJECTID=$(keystone tenant-list | grep -i "${PROJECTS[$i]}" | awk '{print $2}') for user in drebs kwadronaut micah varac elijah do USERID=$(keystone user-list | grep -i $user | awk '{print $2}') - echo $USERID - keystone user-role-add --roleid $ROLEID --userid $USERID --tenant-id $PROJECTID + keystone user-role-add --role-id $ROLEID --user-id $USERID --tenant-id $PROJECTID done - echo "$PROJECTID \n" done |