-
Notifications
You must be signed in to change notification settings - Fork 2
/
novarc
31 lines (29 loc) · 1.17 KB
/
novarc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
unset $param
done
unset _OS_PARAMS
keystone_unit=$(juju status keystone|grep -i workload -A1|tail -n1|awk '{print $1}'|tr -d '*')
echo Keystone unit: ${keystone_unit}
if ! curl -qs `juju exec --unit ${keystone_unit} "unit-get private-address"`:5000/v3 | grep 404 ;
then
echo Using keystone v3 api
export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju exec --unit ${keystone_unit} "unit-get private-address"`:5000/v3
export OS_USERNAME=admin
export OS_PASSWORD=`juju exec --unit keystone/0 leader-get admin_passwd`
export OS_DOMAIN_NAME=admin_domain
export OS_USER_DOMAIN_NAME=admin_domain
export OS_PROJECT_DOMAIN_NAME=admin_domain
export OS_PROJECT_NAME=admin
export OS_REGION_NAME=RegionOne
export OS_IDENTITY_API_VERSION=3
# Swift needs this:
export OS_AUTH_VERSION=3
else
echo Using keystone v2 api
export OS_USERNAME=admin
export OS_PASSWORD=`juju exec --unit keystone/0 leader-get admin_passwd`
export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://`juju exec --unit ${keystone_unit} "unit-get private-address"`:5000/v2.0
fi