diff --git a/deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp b/deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp index 4acf74f24..80849c253 100644 --- a/deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp +++ b/deployment_scripts/puppet/modules/lma_collector/manifests/heka.pp @@ -118,24 +118,23 @@ define lma_collector::heka ( $heka_monitoring_ensure = absent } - if $heka_monitoring { - heka::filter::sandbox { "heka_monitoring_${title}": - ensure => $heka_monitoring_ensure, - config_dir => $config_dir, - filename => "${lma_collector::params::plugins_dir}/filters/heka_monitoring.lua", - message_matcher => "Type == 'heka.all-report'", - require => ::Heka[$title], - module_directory => $lua_modules_dir, - notify => Class[$service_class], - } + heka::filter::sandbox { "heka_monitoring_${title}": + ensure => $heka_monitoring_ensure, + config_dir => $config_dir, + filename => "${lma_collector::params::plugins_dir}/filters/heka_monitoring.lua", + message_matcher => "Type == 'heka.all-report'", + require => ::Heka[$title], + module_directory => $lua_modules_dir, + notify => Class[$service_class], + } - # Dashboard is required to enable monitoring messages - heka::output::dashboard { "dashboard_${title}": - config_dir => $config_dir, - dashboard_address => $lma_collector::params::dashboard_address, - dashboard_port => $dashboard_port, - require => ::Heka[$title], - notify => Class[$service_class], - } + # Dashboard is required to enable monitoring messages + heka::output::dashboard { "dashboard_${title}": + ensure => $heka_monitoring_ensure, + config_dir => $config_dir, + dashboard_address => $lma_collector::params::dashboard_address, + dashboard_port => $dashboard_port, + require => ::Heka[$title], + notify => Class[$service_class], } } diff --git a/deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb b/deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb index 197204382..2bd5df56a 100644 --- a/deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb +++ b/deployment_scripts/puppet/modules/lma_collector/spec/defines/lma_collector_heka_spec.rb @@ -67,8 +67,12 @@ describe 'lma_collector::heka' do ) should contain_heka__input__tcp('metric') should contain_heka__decoder__sandbox('metric' ) - is_expected.to_not contain_heka__filter__sandbox('heka_monitoring_metric_collector') - is_expected.to_not contain_heka__output__dashboard('dashboard_metric_collector' ) + should contain_heka__filter__sandbox('heka_monitoring_metric_collector').with( + 'ensure' => 'absent' + ) + should contain_heka__output__dashboard('dashboard_metric_collector' ).with( + 'ensure' => 'absent' + ) } end end