Only use sentinel when redis ha is chosen

When running in allinone mode, packstack will set any config
variable ending with _HOST to have a value of the controller host.
This was causing the ceilometer coordination_url to inadvertently be
set to use sentinel even when redis high availability was not configured.

By adjusting the template to be more explicit, this is no longer the
case.

Change-Id: I281e9de507f68f4f2a5941b14b5696c91c12fdbb
Closes-Bug: #14336643
This commit is contained in:
Chris Dent
2015-03-18 17:25:22 +00:00
parent 5378834600
commit 85dd2dca6f

View File

@@ -3,11 +3,12 @@ $config_mongodb_host = hiera('CONFIG_MONGODB_HOST')
$config_ceilometer_coordination_backend = hiera('CONFIG_CEILOMETER_COORDINATION_BACKEND')
if $config_ceilometer_coordination_backend == 'redis' {
$redis_ha = hiera('CONFIG_REDIS_HA')
$redis_host = hiera('CONFIG_REDIS_MASTER_HOST')
$redis_port = hiera('CONFIG_REDIS_PORT')
$sentinel_host = hiera('CONFIG_REDIS_SENTINEL_CONTACT_HOST')
$sentinel_fallbacks = hiera('CONFIG_REDIS_SENTINEL_FALLBACKS')
if $sentinel_host != '' {
if ($sentinel_host != '' and $redis_ha == 'y') {
$master_name = hiera('CONFIG_REDIS_MASTER_NAME')
$sentinel_port = hiera('CONFIG_REDIS_SENTINEL_PORT')
$base_coordination_url = "redis://${sentinel_host}:${sentinel_port}?sentinel=${master_name}"