diff options
author | Nicolas Vigier <boklm@mageia.org> | 2012-09-16 20:16:46 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2012-09-16 20:16:46 +0000 |
commit | 764feeb52d90fc0a0419ad19ba8e16d01f724b14 (patch) | |
tree | ab1151247cdbb58f86d97c7a1c2399a8b797458f /modules/rsnapshot/manifests/init.pp | |
parent | 2a0a5d2e4c8c53c0b4de6873a4ef3daba596cd55 (diff) | |
download | puppet-764feeb52d90fc0a0419ad19ba8e16d01f724b14.tar puppet-764feeb52d90fc0a0419ad19ba8e16d01f724b14.tar.gz puppet-764feeb52d90fc0a0419ad19ba8e16d01f724b14.tar.bz2 puppet-764feeb52d90fc0a0419ad19ba8e16d01f724b14.tar.xz puppet-764feeb52d90fc0a0419ad19ba8e16d01f724b14.zip |
add backup define
Diffstat (limited to 'modules/rsnapshot/manifests/init.pp')
-rw-r--r-- | modules/rsnapshot/manifests/init.pp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/modules/rsnapshot/manifests/init.pp b/modules/rsnapshot/manifests/init.pp index 129e05fd..15b54735 100644 --- a/modules/rsnapshot/manifests/init.pp +++ b/modules/rsnapshot/manifests/init.pp @@ -1,5 +1,35 @@ class rsnapshot { - class base { + class base($confdir = '/backups/conf') { package { ['rsnapshot']: } + + file { $confdir: + ensure => directory, + owner => root, + group => root, + mode => 0700, + } + } + + # - 'backup' is an array of "source destination" to backup + # - 'backup_script' is an array of "script destination" + # - ${x}_interval is the number of hourly, daily, weekly, monthly + # backups that should be kept. If you don't want hourly, daily, + # weekly or monthly backups, set ${x}_interval to '0' + define backup( + $snapshot_root = '/backups', + $one_fs = '1', + $backup = [], + $backup_script = [], + $hourly_interval = '0', + $daily_interval = '6', + $weekly_interval = '4', + $monthly_interval = '3' + ) { + file { "${rsnapshot::base::confdir}/${name}.conf": + owner => root, + group => root, + mode => 0700, + content => template('rsnapshot/rsnapshot.conf'), + } } } |