summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
+