-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathopenrcv3_domain
32 lines (30 loc) · 1.12 KB
/
openrcv3_domain
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
31
32
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
if [ "$param" = "OS_AUTH_PROTOCOL" ]; then continue; fi
if [ "$param" = "OS_CACERT" ]; then continue; fi
unset $param
done
unset _OS_PARAMS
_keystone_vip=$(juju config $_juju_model_arg keystone vip)
if [ -n "$_keystone_vip" ]; then
_keystone_ip=$(echo $_keystone_vip | awk '{print $1}')
else
_keystone_ip=$(juju exec $_juju_model_arg --unit keystone/leader -- 'network-get --bind-address public')
fi
_password=$(juju exec $_juju_model_arg --unit keystone/leader 'leader-get admin_passwd')
. $(dirname ${BASH_SOURCE[0]})/_openrcv3_get_root_ca
if [ ! -z "$_root_ca" -a -s "$_root_ca" ]; then
export OS_AUTH_PROTOCOL=https
export OS_CACERT=${_root_ca}
fi
export OS_AUTH_URL=${OS_AUTH_PROTOCOL:-http}://${_keystone_ip}:5000/v3
export OS_USERNAME=admin
export OS_PASSWORD=${_password}
export OS_REGION_NAME=RegionOne
export OS_DOMAIN_NAME=admin_domain
export OS_USER_DOMAIN_NAME=admin_domain
export OS_IDENTITY_API_VERSION=3
# Swift needs this:
export OS_AUTH_VERSION=3
# Gnocchi needs this:
export OS_AUTH_TYPE=password