Files
packstack/packstack/puppet/templates/ceilometer.pp
Chris Dent 85dd2dca6f 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
2015-03-20 14:13:55 +00:00

56 lines
1.7 KiB
Puppet

$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 != '' 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}"
if $sentinel_fallbacks != '' {
$coordination_url = "${base_coordination_url}&${sentinel_fallbacks}"
} else {
$coordination_url = $base_coordination_url
}
} else {
$coordination_url = "redis://${redis_host}:${redis_port}"
}
} else {
$coordination_url = ''
}
class { 'ceilometer::db':
database_connection => "mongodb://${config_mongodb_host}:27017/ceilometer",
}
class { 'ceilometer::collector': }
class { 'ceilometer::agent::notification': }
$config_controller_host = hiera('CONFIG_CONTROLLER_HOST')
class { 'ceilometer::agent::auth':
auth_url => "http://${config_controller_host}:35357/v2.0",
auth_password => hiera('CONFIG_CEILOMETER_KS_PW'),
}
class { 'ceilometer::agent::central':
coordination_url => $coordination_url,
}
class { 'ceilometer::alarm::notifier':}
class { 'ceilometer::alarm::evaluator':
coordination_url => $coordination_url,
}
class { 'ceilometer::api':
keystone_host => hiera('CONFIG_CONTROLLER_HOST'),
keystone_password => hiera('CONFIG_CEILOMETER_KS_PW'),
}