diff options
Diffstat (limited to 'manifests/profile/base/ceilometer')
-rw-r--r-- | manifests/profile/base/ceilometer/agent/central.pp | 2 | ||||
-rw-r--r-- | manifests/profile/base/ceilometer/agent/compute.pp | 2 | ||||
-rw-r--r-- | manifests/profile/base/ceilometer/agent/notification.pp | 2 | ||||
-rw-r--r-- | manifests/profile/base/ceilometer/api.pp | 4 | ||||
-rw-r--r-- | manifests/profile/base/ceilometer/collector.pp | 56 | ||||
-rw-r--r-- | manifests/profile/base/ceilometer/expirer.pp | 5 |
6 files changed, 47 insertions, 24 deletions
diff --git a/manifests/profile/base/ceilometer/agent/central.pp b/manifests/profile/base/ceilometer/agent/central.pp index 02d6d1a..c91e610 100644 --- a/manifests/profile/base/ceilometer/agent/central.pp +++ b/manifests/profile/base/ceilometer/agent/central.pp @@ -23,11 +23,9 @@ # for more details. # Defaults to hiera('step') # - class tripleo::profile::base::ceilometer::agent::central ( $step = hiera('step'), ) { - include ::tripleo::profile::base::ceilometer if $step >= 4 { diff --git a/manifests/profile/base/ceilometer/agent/compute.pp b/manifests/profile/base/ceilometer/agent/compute.pp index 3a7aa50..749bc64 100644 --- a/manifests/profile/base/ceilometer/agent/compute.pp +++ b/manifests/profile/base/ceilometer/agent/compute.pp @@ -23,11 +23,9 @@ # for more details. # Defaults to hiera('step') # - class tripleo::profile::base::ceilometer::agent::compute ( $step = hiera('step'), ) { - include ::tripleo::profile::base::ceilometer if $step >= 4 { diff --git a/manifests/profile/base/ceilometer/agent/notification.pp b/manifests/profile/base/ceilometer/agent/notification.pp index 83a0234..7fe8e81 100644 --- a/manifests/profile/base/ceilometer/agent/notification.pp +++ b/manifests/profile/base/ceilometer/agent/notification.pp @@ -23,11 +23,9 @@ # for more details. # Defaults to hiera('step') # - class tripleo::profile::base::ceilometer::agent::notification ( $step = hiera('step'), ) { - include ::tripleo::profile::base::ceilometer if $step >= 4 { diff --git a/manifests/profile/base/ceilometer/api.pp b/manifests/profile/base/ceilometer/api.pp index e324c00..da94da2 100644 --- a/manifests/profile/base/ceilometer/api.pp +++ b/manifests/profile/base/ceilometer/api.pp @@ -23,15 +23,13 @@ # for more details. # Defaults to hiera('step') # - class tripleo::profile::base::ceilometer::api ( $step = hiera('step'), ) { - include ::tripleo::profile::base::ceilometer if $step >= 4 { include ::ceilometer::api + include ::ceilometer::wsgi::apache } - } diff --git a/manifests/profile/base/ceilometer/collector.pp b/manifests/profile/base/ceilometer/collector.pp index 34ee90b..baaf4c8 100644 --- a/manifests/profile/base/ceilometer/collector.pp +++ b/manifests/profile/base/ceilometer/collector.pp @@ -18,31 +18,63 @@ # # === Parameters # +# [*bootstrap_node*] +# (Optional) The hostname of the node responsible for bootstrapping tasks +# Defaults to hiera('bootstrap_nodeid') +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. # Defaults to hiera('step') # -# [*sync_db*] -# (Optional) Whether to run db sync -# Defaults to true -# - class tripleo::profile::base::ceilometer::collector ( - $step = hiera('step'), - $sync_db = true, + $bootstrap_node = hiera('bootstrap_nodeid', undef), + $step = hiera('step'), ) { + if $::hostname == downcase($bootstrap_node) { + $sync_db = true + } else { + $sync_db = false + } + + $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('mongodb_node_ips'), '[') + $mongo_node_ips_with_port = suffix($mongo_node_ips_with_port_prefixed, ']:27017') + $mongo_node_ips_with_port_nobr = suffix(hiera('mongodb_node_ips'), ':27017') + } else { + $mongo_node_ips_with_port = suffix(hiera('mongodb_node_ips'), ':27017') + $mongo_node_ips_with_port_nobr = suffix(hiera('mongodb_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 } diff --git a/manifests/profile/base/ceilometer/expirer.pp b/manifests/profile/base/ceilometer/expirer.pp index 43d8c26..eaaaefc 100644 --- a/manifests/profile/base/ceilometer/expirer.pp +++ b/manifests/profile/base/ceilometer/expirer.pp @@ -23,16 +23,15 @@ # for more details. # Defaults to hiera('step') # - class tripleo::profile::base::ceilometer::expirer ( $step = hiera('step'), ) { - include ::tripleo::profile::base::ceilometer if $step >= 4 { include ::ceilometer::expirer - Cron <| title == 'ceilometer-expirer' |> { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" } + Cron <| title == 'ceilometer-expirer' |> + { command => "sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" } } } |