Skip to content

Commit

Permalink
Revert "Add parameter to allow purging plugins, handlers, extensions …
Browse files Browse the repository at this point in the history
…and mutators"
  • Loading branch information
jlambert121 committed Feb 2, 2015
1 parent fc7baf6 commit 46a65a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 9 additions & 5 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
require => Package['sensu'],
}

file { [ '/etc/sensu/conf.d', '/etc/sensu/conf.d/handlers', '/etc/sensu/conf.d/checks', '/etc/sensu/conf.d/filters', '/etc/sensu/conf.d/extensions',
'/etc/sensu/handlers', '/etc/sensu/extensions', '/etc/sensu/mutators', '/etc/sensu/extensions/handlers' ]:
file { [ '/etc/sensu/conf.d', '/etc/sensu/conf.d/handlers', '/etc/sensu/conf.d/checks', '/etc/sensu/conf.d/filters', '/etc/sensu/conf.d/extensions' ]:
ensure => directory,
owner => 'sensu',
group => 'sensu',
Expand All @@ -71,15 +70,20 @@
require => Package['sensu'],
}

file { ['/etc/sensu/handlers', '/etc/sensu/extensions', '/etc/sensu/mutators', '/etc/sensu/extensions/handlers']:
ensure => directory,
mode => '0555',
owner => 'sensu',
group => 'sensu',
require => Package['sensu'],
}

if $sensu::_manage_plugins_dir {
file { '/etc/sensu/plugins':
ensure => directory,
mode => '0555',
owner => 'sensu',
group => 'sensu',
purge => $sensu::purge_config,
recurse => true,
force => true,
require => Package['sensu'],
}
}
Expand Down
10 changes: 3 additions & 7 deletions spec/classes/sensu_package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
it { should create_class('sensu::package') }
it { should contain_package('sensu').with_ensure('latest') }
it { should contain_file('/etc/default/sensu') }
[ '/etc/sensu/conf.d', '/etc/sensu/conf.d/handlers', '/etc/sensu/conf.d/checks',
'/etc/sensu/handlers', '/etc/sensu/extensions', '/etc/sensu/mutators',
'/etc/sensu/extensions/handlers', '/etc/sensu/plugins'].each do |dir|
[ '/etc/sensu/conf.d', '/etc/sensu/conf.d/handlers', '/etc/sensu/conf.d/checks' ].each do |dir|
it { should contain_file(dir).with(
:ensure => 'directory',
:recurse => true,
:purge => false
) }
end
Expand Down Expand Up @@ -146,16 +143,15 @@
context 'purge_config' do
let(:params) { { :purge_config => true } }

[ '/etc/sensu/conf.d', '/etc/sensu/conf.d/handlers', '/etc/sensu/conf.d/checks',
'/etc/sensu/handlers', '/etc/sensu/extensions', '/etc/sensu/mutators',
'/etc/sensu/extensions/handlers', '/etc/sensu/plugins' ].each do |dir|
[ '/etc/sensu/conf.d', '/etc/sensu/conf.d/handlers', '/etc/sensu/conf.d/checks' ].each do |dir|
it { should contain_file(dir).with(
:ensure => 'directory',
:purge => true,
:recurse => true,
:force => true
) }
end

end
end

Expand Down

0 comments on commit 46a65a0

Please sign in to comment.