summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-18 18:05:47 +0000
committerGerrit Code Review <review@openstack.org>2019-01-18 18:05:47 +0000
commit2b181a94a3155c6d4bbb8549a293b9b3ccb50c5d (patch)
tree1ea762c475758dd4110b513e9388529046adc464
parent3d231ecc250092ded46c69da3757033ceb992806 (diff)
parentd0833fb4d67fb12299acd91b478e0c014604b0e0 (diff)
Merge "Script for adding openstack users"
-rwxr-xr-xtools/openstack-user-add41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/openstack-user-add b/tools/openstack-user-add
new file mode 100755
index 0000000..5660fd5
--- /dev/null
+++ b/tools/openstack-user-add
@@ -0,0 +1,41 @@
1#!/bin/bash
2
3if [ -z "$2" ]; then
4 echo "Usage: openstack-user-add <user> <email>"
5 exit 1
6fi
7
8
9OS_USER=$1
10OS_PROJ="${OS_USER}-proj"
11OS_EMAIL=$2
12
13OS_PASSWD=`openssl rand -hex 10`
14OS_DOMAIN='default'
15
16openstack domain create --or-show --enable ${OS_DOMAIN}
17
18openstack project create --or-show --enable \
19 --domain ${OS_DOMAIN} ${OS_PROJ}
20
21openstack user create --or-show --enable \
22 --domain ${OS_DOMAIN} \
23 --email ${OS_EMAIL} ${OS_USER}
24
25openstack user set --domain ${OS_DOMAIN} \
26 --password=${OS_PASSWD} ${OS_USER}
27
28openstack role add --project-domain ${OS_DOMAIN} \
29 --user-domain ${OS_DOMAIN} \
30 --project ${OS_PROJ} \
31 --user ${OS_USER} member
32
33openstack quota set --floating-ips 4 ${OS_PROJ}
34openstack quota set --cores 36 ${OS_PROJ}
35openstack quota set --ram 98304 ${OS_PROJ}
36
37echo https://dashboard.atlantafoundry.com/
38echo "Domain: ${OS_DOMAIN}"
39echo "User: ${OS_USER}"
40echo "Passwd: ${OS_PASSWD}"
41