mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2024-12-16 09:40:35 +00:00
Merge branch 'feature/create_run_dir-issue#12' into develop
fix issue#12
This commit is contained in:
commit
94b890df6d
@ -10,5 +10,14 @@ class rsnapshot::install {
|
||||
ensure => $rsnapshot::package_ensure,
|
||||
}
|
||||
|
||||
# ensure run directory exists (systemd clears /var/run, so rsnapshot can't create PID files after reboot - issue#12)
|
||||
$lockpath = pick($rsnapshot::lockpath, $rsnapshot::params::config_lockpath, '/var/run/rsnapshot')
|
||||
$tmpfiles_d = '/etc/tmpfiles.d'
|
||||
|
||||
file { "${tmpfiles_d}/rsnapshot.conf":
|
||||
ensure => present,
|
||||
content => "D ${lockpath} 0755 root root -",
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -28,13 +28,20 @@ describe 'rsnapshot' do
|
||||
end
|
||||
end
|
||||
context 'files provisioned' do
|
||||
describe file('/etc/tmpfiles.d/rsnapshot.conf') do
|
||||
it { is_expected.to exist }
|
||||
its(:content) { is_expected.to match 'D /var/run/rsnapshot 0755 root root -' }
|
||||
end
|
||||
describe file('/var/run/rsnapshot') do
|
||||
it { should be_directory }
|
||||
end
|
||||
describe file('/etc/rsnapshot/localhost.rsnapshot.conf') do
|
||||
it { is_expected.to exist }
|
||||
its(:content) { is_expected.to match 'backup' }
|
||||
end
|
||||
describe file('/etc/rsnapshot/example.com.rsnapshot.conf') do
|
||||
it { is_expected.to exist }
|
||||
its(:content) { is_expected.to match 'backup' }
|
||||
its(:content) { is_expected.to match 'backup\troot@example.com:/var/\t./' }
|
||||
end
|
||||
describe file('/etc/rsnapshot.conf') do
|
||||
it { is_expected.to exist }
|
||||
|
Loading…
Reference in New Issue
Block a user