Merge "Setup Keystone catalog information for Ceilometer"

This commit is contained in:
Jenkins 2014-01-13 17:46:26 +00:00 committed by Gerrit Code Review
commit 434fac566b
3 changed files with 51 additions and 0 deletions

View File

@ -51,3 +51,8 @@ catalog.RegionOne.orchestration.publicURL = http://%SERVICE_HOST%:8000/v1
catalog.RegionOne.orchestration.adminURL = http://%SERVICE_HOST%:8000/v1
catalog.RegionOne.orchestration.internalURL = http://%SERVICE_HOST%:8000/v1
catalog.RegionOne.orchestration.name = Heat Service
catalog.RegionOne.metering.publicURL = http://%SERVICE_HOST%:8777/v1
catalog.RegionOne.metering.adminURL = http://%SERVICE_HOST%:8777/v1
catalog.RegionOne.metering.internalURL = http://%SERVICE_HOST%:8777/v1
catalog.RegionOne.metering.name = Telemetry Service

View File

@ -48,8 +48,50 @@ CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
# Set up database backend
CEILOMETER_BACKEND=${CEILOMETER_BACKEND:-mysql}
# Ceilometer connection info.
CEILOMETER_SERVICE_PROTOCOL=http
CEILOMETER_SERVICE_HOST=$SERVICE_HOST
CEILOMETER_SERVICE_PORT=${CEILOMETER_SERVICE_PORT:-8777}
#
# Functions
# ---------
#
# create_ceilometer_accounts() - Set up common required ceilometer accounts
create_ceilometer_accounts() {
SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
ADMIN_ROLE=$(keystone role-list | awk "/ admin / { print \$2 }")
# Ceilometer
if [[ "$ENABLED_SERVICES" =~ "ceilometer-api" ]]; then
CEILOMETER_USER=$(keystone user-create \
--name=ceilometer \
--pass="$SERVICE_PASSWORD" \
--tenant_id $SERVICE_TENANT \
--email=ceilometer@example.com \
| grep " id " | get_field 2)
keystone user-role-add \
--tenant-id $SERVICE_TENANT \
--user-id $CEILOMETER_USER \
--role-id $ADMIN_ROLE
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
CEILOMETER_SERVICE=$(keystone service-create \
--name=ceilometer \
--type=metering \
--description="OpenStack Telemetry Service" \
| grep " id " | get_field 2)
keystone endpoint-create \
--region RegionOne \
--service_id $CEILOMETER_SERVICE \
--publicurl "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \
--adminurl "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \
--internalurl "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/"
fi
fi
}
# cleanup_ceilometer() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up

View File

@ -901,6 +901,10 @@ if is_service_enabled key; then
create_trove_accounts
fi
if is_service_enabled ceilometer; then
create_ceilometer_accounts
fi
if is_service_enabled swift || is_service_enabled s-proxy; then
create_swift_accounts
fi