diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-05-19 08:17:47 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-05-19 08:17:47 -0300 |
commit | cfe68b9c2da2ff48171e2bbdb8988b92f7f41ee1 (patch) | |
tree | aa8f650ccb6a7d33b793bb6451d8447da481f176 /manifests/borg.pp | |
parent | ef69b77ccada9e983cd8e79ed92c90a84a8ff9fe (diff) | |
download | puppet-backup-cfe68b9c2da2ff48171e2bbdb8988b92f7f41ee1.tar.gz puppet-backup-cfe68b9c2da2ff48171e2bbdb8988b92f7f41ee1.tar.bz2 |
Adds borg action and misc changes
Diffstat (limited to 'manifests/borg.pp')
-rw-r--r-- | manifests/borg.pp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/manifests/borg.pp b/manifests/borg.pp new file mode 100644 index 0000000..4d08908 --- /dev/null +++ b/manifests/borg.pp @@ -0,0 +1,31 @@ +define backup::borg( + $port = '22', + $ensure = present, + $keepdaily = '7', + $keepweekly = '4', + $keepmonthly = '3', + $user = $::hostname, + $host = "${title}.${::domain}", + $encryption = 'repokey', + $order = 95, + $periodic_check = absent, + $password, +) { + file { "${backupninja::configdir}/${order}_borg-${host}.sh": + ensure => $ensure, + content => template('backup/borg.sh.erb'), + owner => root, + group => root, + mode => '0600', + require => File["${backupninja::configdir}"], + } + + cron { "borg_check-$title.$domain": + command => "/bin/bash ${backupninja::configdir}/${order}_borg-${host}.sh --check", + user => root, + hour => "0", + minute => "0", + weekday => "0", + ensure => $periodic_check, + } +} |