kolla/docker/common/gnocchi/gnocchi-base/config-gnocchi.sh
Swapnil Kulkarni 870ec615d6 Add Gnocchi service to kolla
Co-Authored-By: Swapnil Kulkarni <me@coolsvap.net"
Change-Id: I81e5e6bfde3323e6917e3d61e3db760e2fec2019
Implements: blueprint gnocchi-containers
2015-07-23 03:43:04 +00:00

24 lines
788 B
Bash
Executable File

#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT KEYSTONE_PUBLIC_SERVICE_HOST \
GNOCCHI_STORAGE_BACKEND GNOCCHI_DATA_DIR GNOCCHI_SERVICE_PORT
dump_vars
cat > /openrc <<EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
EOF
cfg=/etc/gnocchi/gnocchi.conf
crudini --set $cfg \
storage driver "$GNOCCHI_STORAGE_BACKEND"
crudini --set $cfg \
storage file_basepath "$GNOCCHI_DATA_DIR"
crudini --set $cfg \
indexer url "mysql://$GNOCCHI_DB_USER:$GNOCCHI_DB_PASSWORD@$MARIADB_SERVICE_HOST/$GNOCCHI_DB_NAME?charset=utf8"