summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwadronaut <kwadronaut@leap.se>2013-07-16 23:38:58 +0200
committerkwadronaut <kwadronaut@leap.se>2013-07-16 23:38:58 +0200
commit5991a660eeb2dbeedfc885b7eb014c7bca46f66d (patch)
treee13e586010d840c12d1535e4fe6602a40ecbecc0
parent4956480626874c50220404510047edfcde6ece30 (diff)
adding users to all projects
-rwxr-xr-xadd-user-roles21
1 files changed, 21 insertions, 0 deletions
diff --git a/add-user-roles b/add-user-roles
new file mode 100755
index 0000000..043b9be
--- /dev/null
+++ b/add-user-roles
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# add user with project-admin role to all projects
+
+#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[@]}
+do
+ PROJECTID=$(keystone tenant-list | grep -i $project | 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
+ done
+ echo "$PROJECTID \n"
+done
+