summaryrefslogtreecommitdiffstats
path: root/tools/keystone/region.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/keystone/region.sh')
-rwxr-xr-xtools/keystone/region.sh103
1 files changed, 88 insertions, 15 deletions
diff --git a/tools/keystone/region.sh b/tools/keystone/region.sh
index f3b0180..1ae108f 100755
--- a/tools/keystone/region.sh
+++ b/tools/keystone/region.sh
@@ -27,26 +27,99 @@ source openrc
#
# 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}
+ENDPOINT_FILE="/root/endpoints.ini"
+
+# Get an option from an INI file
+# iniget config-file section option
+function iniget {
+ local xtrace
+ xtrace=$(set +o | grep xtrace)
+ set +o xtrace
+ local file=$1
+ local section=$2
+ local option=$3
+ local line
+
+ line=$(sed -ne "/^\[$section\]/,/^\[.*\]/ { /^$option[ \t]*=/ p; }" "$file")
+ echo ${line#*=}
+ $xtrace
+}
+
+error () {
+ logger -s -t "registration.error" "$*"
+ exit 1
+}
+
+public_url=$(iniget ${ENDPOINT_FILE} DEFAULT public_url)
+internal_url=$(iniget ${ENDPOINT_FILE} DEFAULT internal_url)
+admin_url=$(iniget ${ENDPOINT_FILE} DEFAULT admin_url)
+region=$(iniget ${ENDPOINT_FILE} DEFAULT os_region)
+
+if [ -z $public_url || -z $internal_url || -z $admin_url || -z $region ]; then
+ error "The provided endpoint information is incomplete. Please che the values for public_url, admin_url, internal_url and os_region."
+fi
# 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
+openstack endpoint create nova public "http://${public_url}:8774/v2.1" --region ${region}
+openstack endpoint create nova admin "http://${admin_url}:8774/v2.1" --region ${region}
+openstack endpoint create nova internal "http://${internal_url}:8774/v2.1" --region ${region}
+
+openstack endpoint create compute_legacy public "http://${public_url}:8774/v2/%(tenant_id)s" --region ${region}
+openstack endpoint create compute_legacy admin "http://${admin_url}:8774/v2/%(tenant_id)s" --region ${region}
+openstack endpoint create compute_legacy internal "http://${internal_url}:8774/v2/%(tenant_id)s" --region ${region}
+
# Neutron
-openstack endpoint create --publicurl "http://${public_url}:9696" --adminurl "http://${admin_url}:9696" --internalurl "http://${internal_url}:9696" --region ${region} neutron
+openstack endpoint create neutron public "http://${public_url}:9696" --region ${region}
+openstack endpoint create neutron admin "http://${admin_url}:9696" --region ${region}
+openstack endpoint create neutron internal "http://${internal_url}:9696" --region ${region}
+
# 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
+openstack endpoint create cinder public "http://${public_url}:8776/v1/%(tenant_id)s" --region ${region}
+openstack endpoint create cinder admin "http://${admin_url}:8776/v1/%(tenant_id)s" --region ${region}
+openstack endpoint create cinder internal "http://${internal_url}:8776/v1/%(tenant_id)s" --region ${region}
+
+openstack endpoint create cinderv2 public "http://${public_url}:8776/v2/%(tenant_id)s" --region ${region}
+openstack endpoint create cinderv2 admin "http://${admin_url}:8776/v2/%(tenant_id)s" --region ${region}
+openstack endpoint create cinderv2 internal "http://${internal_url}:8776/v2/%(tenant_id)s" --region ${region}
+
+openstack endpoint create cinderv3 public "http://${public_url}:8776/v3/%(tenant_id)s" --region ${region}
+openstack endpoint create cinderv3 admin "http://${admin_url}:8776/v3/%(tenant_id)s" --region ${region}
+openstack endpoint create cinderv3 internal "http://${internal_url}:8776/v3/%(tenant_id)s" --region ${region}
+
# Glance
-openstack endpoint create --publicurl "http://${public_url}:9292" --adminurl "http://${admin_url}:9292" --internalurl "http://${internal_url}:9292" --region ${region} glance
+openstack endpoint create glance public "http://${public_url}:9292" --region ${region}
+openstack endpoint create glance admin "http://${admin_url}:9292" --region ${region}
+openstack endpoint create glance internal "http://${internal_url}:9292" --region ${region}
+
# 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
+openstack endpoint create heat public "http://${public_url}:8004/v1/%(tenant_id)s" --region ${region}
+openstack endpoint create heat admin "http://${admin_url}:8004/v1/%(tenant_id)s" --region ${region}
+openstack endpoint create heat internal "http://${internal_url}:8004/v1/%(tenant_id)s" --region ${region}
+
+openstack endpoint create heat-cfn public "http://${public_url}:8000/v1" --region ${region}
+openstack endpoint create heat-cfn admin "http://${admin_url}:8004/v1/%(tenant_id)s" --region ${region}
+openstack endpoint create heat-cfn internal "http://${internal_url}:8004/v1/%(tenant_id)s" --region ${region}
+
# 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
+openstack endpoint create swift public "http://${public_url}:8080/v1/AUTH_%(tenant_id)s" --region ${region}
+openstack endpoint create swift admin "http://${admin_url}:8080/v1/AUTH_%(tenant_id)s" --region ${region}
+openstack endpoint create swift internal "http://${internal_url}:8080/v1/AUTH_%(tenant_id)s" --region ${region}
+
+openstack endpoint create swift_s3 public "http://${public_url}:8080" --region ${region}
+openstack endpoint create swift_s3 admin "http://${admin_url}:8080" --region ${region}
+openstack endpoint create swift_s3 internal "http://${internal_url}:8080" --region ${region}
+
# 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
+openstack endpoint create glare public "http://${public_url}:9494" --region ${region}
+openstack endpoint create glare admin "http://${admin_url}:9494" --region ${region}
+openstack endpoint create glare internal "http://${internal_url}:9494" --region ${region}
+
+# Ceilometer
+openstack endpoint create ceilometer public "http://${public_url}:8777" --region ${region}
+openstack endpoint create ceilometer admin "http://${admin_url}:8777" --region ${region}
+openstack endpoint create ceilometer internal "http://${internal_url}:8777" --region ${region}
+
+#Aodh
+openstack endpoint create aodh public "http://${public_url}:8042" --region ${region}
+openstack endpoint create aodh admin "http://${admin_url}:8042" --region ${region}
+openstack endpoint create aodh internal "http://${internal_url}:8042" --region ${region}