summaryrefslogtreecommitdiffstats
path: root/tools/keystone/endpoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/keystone/endpoint.sh')
-rwxr-xr-xtools/keystone/endpoint.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/keystone/endpoint.sh b/tools/keystone/endpoint.sh
index 410a723..1bb6c9b 100755
--- a/tools/keystone/endpoint.sh
+++ b/tools/keystone/endpoint.sh
@@ -16,12 +16,15 @@ set -o pipefail
# Ensure that openrc containing OpenStack environment variables is present.
source openrc
+# Always executed on controller
+ENDPOINT_FILE="/root/endpoints.ini"
+
# Endpoints. Dynamically get IP addresses from another service (keystone)
ENDPOINT_PUBLIC_URL=$(openstack endpoint list | grep keystone | grep public | cut -d '|' -f 8 | cut -d '/' -f 3 | cut -d ':' -f 1)
ENDPOINT_ADMIN_URL=$(openstack endpoint list | grep keystone | grep admin | cut -d '|' -f 8 | cut -d '/' -f 3 | cut -d ':' -f 1)
ENDPOINT_INTERNAL_URL=$(openstack endpoint list | grep keystone | grep internal | cut -d '|' -f 8 | cut -d '/' -f 3 | cut -d ':' -f 1)
-cat <<EOT >> /root/endpoints.ini
+cat <<EOT >> ${ENDPOINT_FILE}
[DEFAULT]
public_url=${ENDPOINT_PUBLIC_URL}
admin_url=${ENDPOINT_ADMIN_URL}