1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2024-11-10 00:00:35 +00:00

Merge branch 'release/1.2.2'

- fix issue#12: add /etc/tmpfiles.d/rsnapshot.conf to create run dir
  after reboot
This commit is contained in:
Norbert Varzariu 2017-04-24 20:07:49 +02:00
commit 063df85094
3 changed files with 20 additions and 4 deletions

View File

@ -10,5 +10,14 @@ class rsnapshot::install {
ensure => $rsnapshot::package_ensure, 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

@ -1,6 +1,6 @@
{ {
"name": "loomsen-rsnapshot", "name": "loomsen-rsnapshot",
"version": "1.2.1", "version": "1.2.2",
"author": "loomsen", "author": "loomsen",
"summary": "Configures rsnapshot.", "summary": "Configures rsnapshot.",
"license": "Apache-2.0", "license": "Apache-2.0",
@ -28,11 +28,11 @@
}, },
{ {
"operatingsystem": "Ubuntu", "operatingsystem": "Ubuntu",
"operatingsystemrelease": [ "12.04", "10.04", "14.04" ] "operatingsystemrelease": [ "12.04", "12.10", "13.04", "13.10", "14.04", "14.10", "15.04", "15.10", "16.04", "16.10", "17.04" ]
}, },
{ {
"operatingsystem": "Fedora", "operatingsystem": "Fedora",
"operatingsystemrelease": [ "17", "18", "19", "20", "21", "22", "23", "24" ] "operatingsystemrelease": [ "17", "18", "19", "20", "21", "22", "23", "24", "25" ]
} }
] ]
} }

View File

@ -28,13 +28,20 @@ describe 'rsnapshot' do
end end
end end
context 'files provisioned' do 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 describe file('/etc/rsnapshot/localhost.rsnapshot.conf') do
it { is_expected.to exist } it { is_expected.to exist }
its(:content) { is_expected.to match 'backup' } its(:content) { is_expected.to match 'backup' }
end end
describe file('/etc/rsnapshot/example.com.rsnapshot.conf') do describe file('/etc/rsnapshot/example.com.rsnapshot.conf') do
it { is_expected.to exist } 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 end
describe file('/etc/rsnapshot.conf') do describe file('/etc/rsnapshot.conf') do
it { is_expected.to exist } it { is_expected.to exist }