From 4b9f995a95f1b56cc729ebe087200de01944360e Mon Sep 17 00:00:00 2001 From: Dimitri Mazmanov Date: Fri, 4 Nov 2016 14:02:40 +0100 Subject: 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 --- tools/keystone/region.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tools/keystone/region.sh 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} + +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 -- cgit 1.2.3-korg