diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-10-13 23:20:55 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-10-13 23:20:55 +0000 |
commit | d410d0fddd52b6ec7a1ba5d0758a9aacdd24e06f (patch) | |
tree | 9d8cc43d7c74189e72ad8f0dcd319de8355bc0e0 | |
parent | 700ad3ee5381135c21a4fddcb1d952d1607fefd0 (diff) | |
parent | 8e70fc19eca7149dff793751fc7a7f5fd2ad74f5 (diff) |
Merge "Only run ceilometer::db::sync on bootstrap node"
-rw-r--r-- | manifests/profile/base/ceilometer/collector.pp | 9 | ||||
-rw-r--r-- | spec/classes/tripleo_profile_base_ceilometer_collector_spec.rb | 9 |
2 files changed, 11 insertions, 7 deletions
diff --git a/manifests/profile/base/ceilometer/collector.pp b/manifests/profile/base/ceilometer/collector.pp index 443873f..3c0a361 100644 --- a/manifests/profile/base/ceilometer/collector.pp +++ b/manifests/profile/base/ceilometer/collector.pp @@ -60,10 +60,6 @@ class tripleo::profile::base::ceilometer::collector ( include ::tripleo::profile::base::ceilometer - if $step >= 3 and $sync_db { - include ::ceilometer::db::sync - } - if $step >= 4 or ($step >= 3 and $sync_db) { if downcase($ceilometer_backend) == 'mongodb' { if empty($mongodb_node_ips) { @@ -88,10 +84,13 @@ class tripleo::profile::base::ceilometer::collector ( $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}" class { '::ceilometer::db' : + sync_db => $sync_db, database_connection => $ceilometer_mongodb_conn_string, } } else { - include ::ceilometer::db + class { '::ceilometer::db' : + sync_db => $sync_db, + } } include ::ceilometer::collector include ::ceilometer::dispatcher::gnocchi diff --git a/spec/classes/tripleo_profile_base_ceilometer_collector_spec.rb b/spec/classes/tripleo_profile_base_ceilometer_collector_spec.rb index e262491..718c700 100644 --- a/spec/classes/tripleo_profile_base_ceilometer_collector_spec.rb +++ b/spec/classes/tripleo_profile_base_ceilometer_collector_spec.rb @@ -52,6 +52,7 @@ describe 'tripleo::profile::base::ceilometer::collector' do is_expected.to contain_class('tripleo::profile::base::ceilometer::collector') is_expected.to contain_class('ceilometer::db::sync') is_expected.to contain_class('ceilometer::db').with( + :sync_db => true, :database_connection => 'mongodb://[::1]:27017,[fe80::ca5b:76ff:fe4b:be3b]:27017/ceilometer?replicaSet=replicaset' ) end @@ -72,6 +73,9 @@ describe 'tripleo::profile::base::ceilometer::collector' do is_expected.to contain_class('ceilometer::db').without( :database_connection => 'mongodb://127.0.0.1:27017/ceilometer?replicaSet=replicaset' ) + is_expected.to contain_class('ceilometer::db').with( + :sync_db => true + ) end end @@ -98,6 +102,7 @@ describe 'tripleo::profile::base::ceilometer::collector' do it 'should trigger complete configuration' do is_expected.to contain_class('ceilometer::db::sync') is_expected.to contain_class('ceilometer::db').with( + :sync_db => true, :database_connection => 'mongodb://127.0.0.1:27017/ceilometer?replicaSet=replicaset' ) is_expected.to contain_class('ceilometer::collector') @@ -114,9 +119,9 @@ describe 'tripleo::profile::base::ceilometer::collector' do } } it 'should trigger complete configuration' do - #TODO(aschultz): LP#1629373 - #is_expected.to_not contain_class('ceilometer::db::sync') + is_expected.to_not contain_class('ceilometer::db::sync') is_expected.to contain_class('ceilometer::db').with( + :sync_db => false, :database_connection => 'mongodb://127.0.0.1:27017/ceilometer?replicaSet=replicaset' ) is_expected.to contain_class('ceilometer::collector') |