summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDimitri Mazmanov <dimitri.mazmanov@ericsson.com>2016-11-04 14:02:40 +0100
committerDimitri Mazmanov <dimitri.mazmanov@ericsson.com>2016-11-04 14:06:14 +0100
commit4b9f995a95f1b56cc729ebe087200de01944360e (patch)
treeb27da4c87601307288753c1ddddb02fd8e06a285 /tools
parent240b3bea6659af6d339df888435adecb7e853b26 (diff)
Add new region registration script
The script contains registration of the OpenStack services This is the first part of series of commits to centralize Keystone. Change-Id: I024c5371a1cfa5bd93a0dd7dd7c7738d7a7df642 Signed-off-by: Dimitri Mazmanov <dimitri.mazmanov@ericsson.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/keystone/region.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/tools/keystone/region.sh b/tools/keystone/region.sh
new file mode 100755
index 0000000..f3b0180
--- /dev/null
+++ b/tools/keystone/region.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+#
+# Author: Dimitri Mazmanov (dimitri.mazmanov@ericsson.com)
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+set -o xtrace
+set -o errexit
+set -o nounset
+set -o pipefail
+source openrc
+
+# This script registers a new OpenStack region in Keystone.
+# It relies on availability of the following environment variables
+#
+# $NEW_PUBLIC_URL - public URL for the OpenStack services
+# $NEW_INTERNAL_URL - internal URL for the OpenStack services
+# $NEW_ADMIN_URL - admin URL for the OpenStack services. Typically the same as internal URL
+# $NEW_REGION - new region name. E.g. RegionTwo
+#
+# Invoke the script on the master region - the region which hosts a centralized Keystone instance.
+# Additional services can be register using the following pattern:
+#
+# openstack endpoint create --publicurl "" --adminurl "" --internalurl "" --region ${region} <service>
+
+public_url=${NEW_PUBLIC_URL}
+internal_url=${NEW_INTERNAL_URL}
+admin_url=${NEW_ADMIN_URL}
+region=${NEW_REGION}
+
+# Nova
+openstack endpoint create --publicurl "http://${public_url}:8774/v2.1" --adminurl "http://${admin_url}:8774/v2.1" --internalurl "http://${internal_url}:8774/v2.1" --region ${region} nova
+openstack endpoint create --publicurl "http://${public_url}:8774/v2/%(tenant_id)s" --adminurl "http://${admin_url}:8774/v2/%(tenant_id)s" --internalurl "http://${internal_url}:8774/v2/%(tenant_id)s" --region ${region} compute_legacy
+# Neutron
+openstack endpoint create --publicurl "http://${public_url}:9696" --adminurl "http://${admin_url}:9696" --internalurl "http://${internal_url}:9696" --region ${region} neutron
+# Cinder
+openstack endpoint create --publicurl "http://${public_url}:8776/v1/%(tenant_id)s" --adminurl "http://${admin_url}:8776/v1/%(tenant_id)s" --internalurl "http://${internal_url}:8776/v1/%(tenant_id)s" --region ${region} cinder
+openstack endpoint create --publicurl "http://${public_url}:8776/v2/%(tenant_id)s" --adminurl "http://${admin_url}:8776/v2/%(tenant_id)s" --internalurl "http://${internal_url}:8776/v2/%(tenant_id)s" --region ${region} cinderv2
+openstack endpoint create --publicurl "http://${public_url}:8776/v3/%(tenant_id)s" --adminurl "http://${admin_url}:8776/v3/%(tenant_id)s" --internalurl "http://${internal_url}:8776/v3/%(tenant_id)s" --region ${region} cinderv3
+# Glance
+openstack endpoint create --publicurl "http://${public_url}:9292" --adminurl "http://${admin_url}:9292" --internalurl "http://${internal_url}:9292" --region ${region} glance
+# Heat
+openstack endpoint create --publicurl "http://${public_url}:8004/v1/%(tenant_id)s" --adminurl "http://${admin_url}:8004/v1/%(tenant_id)s" --internalurl "http://${internal_url}:8004/v1/%(tenant_id)s" --region ${region} heat
+openstack endpoint create --publicurl "http://${public_url}:8000/v1" --adminurl "http://${admin_url}:8000/v1" --internalurl "http://${internal_url}:8000/v1" --region ${region} heat-cfn
+# Swift
+openstack endpoint create --publicurl "http://${public_url}:8080/swift/v1" --adminurl "http://${admin_url}:8080/swift/v1" --internalurl "http://${internal_url}:8080/swift/v1" --region ${region} swift
+# Glare
+openstack endpoint create --publicurl "http://${public_url}:9494" --adminurl "http://${admin_url}:9494" --internalurl "http://${internal_url}:9494" --region ${region} swift \ No newline at end of file