1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2024-09-19 17:10:34 +00:00

add tmpfiles.d config - issue#12

This commit is contained in:
Norbert Varzariu 2017-04-24 19:25:16 +02:00
parent 2590264764
commit e1f5fa7ebe
2 changed files with 13 additions and 0 deletions

View File

@ -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 -",
}
}

View File

@ -28,6 +28,10 @@ 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('/etc/rsnapshot/localhost.rsnapshot.conf') do
it { is_expected.to exist }
its(:content) { is_expected.to match 'backup' }