summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-04-28 13:04:39 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-01 12:23:42 (GMT)
commit05a6672c81c56d4c73a77582bc30d104ccece8aa (patch)
tree5fb7eaec85064870c92caa6cb3208dfa4f154fe9
parentbce3046097b9f0b760225f28d5b268b006124145 (diff)
downloaddefinitions-05a6672c81c56d4c73a77582bc30d104ccece8aa.tar.gz
openstack: improve ceilometer configuration extension
Change-Id: Ie14289e4fe23979d6d0d3f65658c0b48f0b1de18
-rw-r--r--openstack-ceilometer.configure58
1 files changed, 25 insertions, 33 deletions
diff --git a/openstack-ceilometer.configure b/openstack-ceilometer.configure
index 0f51667..9c0b7b6 100644
--- a/openstack-ceilometer.configure
+++ b/openstack-ceilometer.configure
@@ -19,44 +19,11 @@ set -e
ROOT="$1"
-##########################################################################
-
enable(){
ln -sf "/usr/lib/systemd/system/$1.service" \
"$ROOT/etc/systemd/system/multi-user.target.wants/$1.service"
}
-##########################################################################
-# Check variables
-##########################################################################
-
-if [ -z "$CEILOMETER_SERVICE_USER" -a \
- -z "$CEILOMETER_SERVICE_PASSWORD" -a \
- -z "$CEILOMETER_DB_USER" -a \
- -z "$CEILOMETER_DB_PASSWORD" -a \
- -z "$METERING_SECRET" ]; then
- # No Ceilometer options defined, do nothing.
- exit 0
-fi
-
-if [ -z "$KEYSTONE_TEMPORARY_ADMIN_TOKEN" -o \
- -z "$CEILOMETER_SERVICE_USER" -o \
- -z "$CEILOMETER_SERVICE_PASSWORD" -o \
- -z "$CEILOMETER_DB_USER" -o \
- -z "$CEILOMETER_DB_PASSWORD" -o \
- -z "$METERING_SECRET" -o \
- -z "$RABBITMQ_HOST" -o \
- -z "$RABBITMQ_PORT" -o \
- -z "$RABBITMQ_USER" -o \
- -z "$RABBITMQ_PASSWORD" -o \
- -z "$MANAGEMENT_INTERFACE_IP_ADDRESS" -o \
- -z "$CONTROLLER_HOST_ADDRESS" ]; then
- echo Some options required for Ceilometer were defined, but not all.
- exit 1
-fi
-
-# Check optional variables
-
unnaceptable(){
eval echo Unexpected value \$$1 for $1 >&2
exit 1
@@ -76,9 +43,34 @@ check_bool(){
esac
}
+##########################################################################
+# Check variables
+##########################################################################
+
check_bool CEILOMETER_ENABLE_CONTROLLER
check_bool CEILOMETER_ENABLE_COMPUTE
+if ! "$CEILOMETER_ENABLE_CONTROLLER" && \
+ ! "$CEILOMETER_ENABLE_COMPUTE"; then
+ exit 0
+fi
+
+if [ -z "$KEYSTONE_TEMPORARY_ADMIN_TOKEN" -o \
+ -z "$CEILOMETER_SERVICE_USER" -o \
+ -z "$CEILOMETER_SERVICE_PASSWORD" -o \
+ -z "$CEILOMETER_DB_USER" -o \
+ -z "$CEILOMETER_DB_PASSWORD" -o \
+ -z "$METERING_SECRET" -o \
+ -z "$RABBITMQ_HOST" -o \
+ -z "$RABBITMQ_PORT" -o \
+ -z "$RABBITMQ_USER" -o \
+ -z "$RABBITMQ_PASSWORD" -o \
+ -z "$MANAGEMENT_INTERFACE_IP_ADDRESS" -o \
+ -z "$CONTROLLER_HOST_ADDRESS" ]; then
+ echo Some options required for Ceilometer were defined, but not all.
+ exit 1
+fi
+
######################################
# Enable relevant openstack services #
######################################