summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaspars Skels <kaspars.skels@gmail.com>2019-01-16 23:43:04 -0600
committerKaspars Skels <kaspars.skels@gmail.com>2019-01-17 12:02:03 -0600
commitd0833fb4d67fb12299acd91b478e0c014604b0e0 (patch)
treead53ae27aa635292af7e424083a5e160f8cf2c4a
parent92d7452a9b93dd94af935930d28b76fe24d82cbb (diff)
Script for adding openstack users
Notes
Notes (review): Code-Review+1: Evgeniy L <eli@mirantis.com> Code-Review+2: Craig Anderson <craig.anderson@att.com> Code-Review+1: Steve Wilkerson <wilkers.steve@gmail.com> Code-Review+2: Sean Eagan <sean.eagan@att.com> Workflow+1: Sean Eagan <sean.eagan@att.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 18 Jan 2019 18:05:47 +0000 Reviewed-on: https://review.openstack.org/631401 Project: openstack/airship-treasuremap Branch: refs/heads/master
-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