summaryrefslogtreecommitdiffstats
path: root/manifests/profile/base
diff options
context:
space:
mode:
authorPradeep Kilambi <pkilambi@redhat.com>2016-07-01 14:16:52 -0400
committerEmilien Macchi <emilien@redhat.com>2016-07-06 22:50:49 -0400
commit0f5f8f09296621036dc84e409aa4fda5649bb052 (patch)
treeae3270ae50b9b39dc26eb1ea2317b024d62e1fc7 /manifests/profile/base
parent9f0ab60383509548e91740ec6559ab9af0f04199 (diff)
Fix Ceilometer profiles
* Configure ceilometer to default mongodb backend. * remove useless sync_db parameter in pacemaker class. * Remove duplicated resource for ceilometer central agent service with pcmk. * Remove pacemaker delay resource dependency, the resource does not exist anymore. Change-Id: Ie337bfe770c5b22158dc307eb36e39c2b93b95a9
Diffstat (limited to 'manifests/profile/base')
-rw-r--r--manifests/profile/base/ceilometer.pp10
-rw-r--r--manifests/profile/base/ceilometer/collector.pp38
2 files changed, 35 insertions, 13 deletions
diff --git a/manifests/profile/base/ceilometer.pp b/manifests/profile/base/ceilometer.pp
index 97e1bb8..88818de 100644
--- a/manifests/profile/base/ceilometer.pp
+++ b/manifests/profile/base/ceilometer.pp
@@ -23,18 +23,12 @@
# for more details.
# Defaults to hiera('step')
#
-# [*sync_db*]
-# (Optional) Whether to run db sync
-# Defaults to true
-#
class tripleo::profile::base::ceilometer (
- $step = hiera('step'),
- $sync_db = true,
+ $step = hiera('step'),
) {
- if $step >= 4 or ($step >= 3 and $sync_db) {
+ if $step >= 3 {
include ::ceilometer
- include ::ceilometer::db
include ::ceilometer::config
}
diff --git a/manifests/profile/base/ceilometer/collector.pp b/manifests/profile/base/ceilometer/collector.pp
index 34ee90b..c294e56 100644
--- a/manifests/profile/base/ceilometer/collector.pp
+++ b/manifests/profile/base/ceilometer/collector.pp
@@ -33,16 +33,44 @@ class tripleo::profile::base::ceilometer::collector (
$sync_db = true,
) {
+ $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb'))
+ # MongoDB
+ if $ceilometer_backend == 'mongodb' {
+ # NOTE(gfidente): We need to pass the list of IPv6 addresses *with* port and
+ # without the brackets as 'members' argument for the 'mongodb_replset'
+ # resource.
+ if str2bool(hiera('mongodb::server::ipv6', false)) {
+ $mongo_node_ips_with_port_prefixed = prefix(hiera('mongo_node_ips'), '[')
+ $mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017')
+ $mongo_node_ips_with_port_nobr = suffix(hiera('mongo_node_ips'), ':27017')
+ } else {
+ $mongo_node_ips_with_port = suffix(hiera('mongo_node_ips'), ':27017')
+ $mongo_node_ips_with_port_nobr = suffix(hiera('mongo_node_ips'), ':27017')
+ }
+ $mongo_node_string = join($mongo_node_ips_with_port, ',')
+
+ $mongodb_replset = hiera('mongodb::server::replset')
+ $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}"
+ }
+
include ::tripleo::profile::base::ceilometer
+ if $step >= 2 and $sync_db and $ceilometer_backend == 'mysql' {
+ include ::ceilometer::db::mysql
+ }
+
if $step >= 3 and $sync_db {
- $ceilometer_backend = downcase(hiera('ceilometer_backend', 'mongodb'))
- if $ceilometer_backend == 'mysql' {
- include ::ceilometer::db::mysql
- }
+ include ::ceilometer::db::sync
}
- if $step >= 4 {
+ if $step >= 4 or ($step >= 3 and $sync_db) {
+ if $ceilometer_backend == 'mongodb' {
+ class { '::ceilometer::db' :
+ database_connection => $ceilometer_mongodb_conn_string,
+ }
+ } else {
+ include ::ceilometer::db
+ }
include ::ceilometer::collector
include ::ceilometer::dispatcher::gnocchi
}