diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-08-20 11:32:52 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-08-20 11:32:52 -0300 |
commit | 9afb297ee9ea87061b83fa17d4195946443ed80e (patch) | |
tree | f3e928eb3bdc4ee272deb709a7f6c9d86c0f990a /manifests/duplicity.pp | |
parent | 3bc1d3326b743b11687d78555dca4c9cfa204f52 (diff) | |
download | puppet-backup-9afb297ee9ea87061b83fa17d4195946443ed80e.tar.gz puppet-backup-9afb297ee9ea87061b83fa17d4195946443ed80e.tar.bz2 |
Changes for autoloading
Diffstat (limited to 'manifests/duplicity.pp')
-rw-r--r-- | manifests/duplicity.pp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/manifests/duplicity.pp b/manifests/duplicity.pp new file mode 100644 index 0000000..115efb1 --- /dev/null +++ b/manifests/duplicity.pp @@ -0,0 +1,48 @@ +# local backups using duplicity +define backup::duplicity( + $encryptkey = false, + $password = false, + $order = 50, + $ensure = present, + $full_if_older_than = "1M", + $remove_older_than = "45D", + $remove_all_but_n_full = "1", + $periodic_check = absent, + $directory = "${backup::params::backupdir}/duplicity" +) { + + case $encryptkey { false: { err("need to define a key!") } } + case $password { false: { err("need to define password!") } } + + $exclude_unencrypted = $backup::params::backup_exclude_unencrypted + $include_unencrypted = $backup::params::backup_include_unencrypted + + include backupninja::client + + # backup dest folder + file { "${backup::params::backupdir}/duplicity": + ensure => directory, + owner => "root", + group => "root", + } + + # the backupninja rule for this duplicity backup + file { "${backupninja::client::defaults::configdir}/${order}_duplicity-${title}.sh": + ensure => $ensure, + content => template('backup/dup.conf.erb'), + owner => root, + group => root, + mode => 0600, + require => File["${backupninja::client::defaults::configdir}"], + } + + # check duplicity backups once a week + cron { "duplicity_check-$title.$domain": + command => "/bin/bash ${backupninja::client::defaults::configdir}/${order}_duplicity-${title}.sh --check", + user => root, + hour => "0", + minute => "0", + weekday => "0", + ensure => $periodic_check, + } +} |