Compare commits

...

2 Commits

Author SHA1 Message Date
Charlie Root cf19166215 Merge branch 'master' of https://srcsrv.wikimedia.de/WMDE/puppet-wmdeit_backup 2021-06-25 17:29:08 +02:00
Charlie Root d481469552 Works un Ubunt/Debian now 2021-06-25 17:28:11 +02:00
2 changed files with 16 additions and 3 deletions

View File

@ -25,8 +25,8 @@ define wmdeit_backup::borg_backup
(
$server = $title,
$dirs = [],
$encryption = "keyfile",
$passphrase = "",
$encryption = "repokey",
$passphrase = "`/bin/cat /root/borg_passphrase.txt`",
$ssh_user = 'root',
$ssh_port = '22',
$ssh_check_hostkey = 'no',
@ -40,6 +40,8 @@ define wmdeit_backup::borg_backup
$repos = $wmdeit_backup::borg::repos
$borg_cmd = $wmdeit_backup::borg::borg_cmd
$sshfs_options = $wmdeit_backup::borg::sshfs_options
$repo = "$repos/$title"
@ -62,7 +64,7 @@ define wmdeit_backup::borg_backup
content => "#!/bin/sh
export BORG_PASSPHRASE=$passphrase
D=`date +%F`
$wmdeit_backup::borg::sshfs_cmd -oStrictHostKeyChecking=$ssh_check_hostkey -oPort=$ssh_port $ssh_user@$server:/ $mnt
$wmdeit_backup::borg::sshfs_cmd $sshfs_options -oStrictHostKeyChecking=$ssh_check_hostkey -oPort=$ssh_port $ssh_user@$server:/ $mnt
cd $mnt
CMD=\"$borg_cmd create ${repo}::$title-\${D} $backup_dirs\"
\$CMD

View File

@ -12,8 +12,19 @@ class wmdeit_backup::params {
]
$sshfs_cmd = '/usr/local/bin/sshfs'
$sshfs_options = '-o direct_io' # buggy sshfs driver under freebsd
$borg_cmd = "/usr/local/bin/borg"
}
'Debian': {
$borg_packages = [
"borgbackup",
"sshfs",
]
$borg_cmd = "/usr/bin/borg"
$sshfs_cmd = '/usr/bin/sshfs'
}
default: {
}}