diff options
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'), + } } } |