Skip to content

Commit 2a6ccc1

Browse files
committed
Add dependency on the package to the plugin and handler directories
On first run (on Ubuntu 12.04 at least, Puppet 3.0.1) I hit an issue on first run where the module tries to create directories in /etc/sensu before they are created. /etc/sensu is not defined by the module but is created by the sensu package. The addition of this dependency appears to resolve the first run problem.
1 parent 3bf51e9 commit 2a6ccc1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

manifests/package.pp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
mode => '0555',
3535
owner => 'sensu',
3636
group => 'sensu',
37+
require => Package['sensu'],
3738
}
3839

3940
file { '/etc/sensu/config.json': ensure => absent }

spec/classes/sensu_package_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
it { should create_class('sensu::package') }
88
it { should include_class('sensu::repo') }
99
it { should contain_package('sensu').with_ensure('latest') }
10-
it { should contain_file('/etc/sensu/handlers').with_ensure('directory') }
11-
it { should contain_file('/etc/sensu/plugins').with_ensure('directory') }
10+
it { should contain_file('/etc/sensu/handlers').with_ensure('directory').with_require('Package[sensu]') }
11+
it { should contain_file('/etc/sensu/plugins').with_ensure('directory').with_require('Package[sensu]') }
1212
it { should contain_file('/etc/sensu/config.json').with_ensure('absent') }
1313
end
1414

@@ -25,7 +25,7 @@
2525
'notify' => 'Class[Sensu::Service::Server]'
2626
) }
2727
end
28-
28+
2929
context 'purge_configs' do
3030
let(:params) { { :purge_config => true } }
3131

0 commit comments

Comments
 (0)