From 72bb9a5cd5c20413992f140476d43ca837f65c1d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 19 Mar 2016 11:46:11 -0300 Subject: Adds sandbox param for rsync, rdiff and duplicity --- manifests/duplicity.pp | 25 ++++++++++++++----------- manifests/rdiff.pp | 27 +++++++++++++++------------ manifests/rsync.pp | 27 +++++++++++++++------------ 3 files changed, 44 insertions(+), 35 deletions(-) diff --git a/manifests/duplicity.pp b/manifests/duplicity.pp index a05da87..bb70045 100644 --- a/manifests/duplicity.pp +++ b/manifests/duplicity.pp @@ -90,6 +90,7 @@ define backupninja::duplicity( $order = 90, $ssh_dir_manage = true, $ssh_dir = "${destdir}/.ssh", $authorized_keys_file = 'authorized_keys', + $sandbox = true, $installuser = true, $backuptag = "backupninja-${::fqdn}", # key options @@ -104,17 +105,19 @@ define backupninja::duplicity( $order = 90, case $password { false: { err("a password is necessary either to unlock the GPG key, or for symmetric encryption!") } } # guarantees there's a configured backup space for this backup - backupninja::server::sandbox { "${user}-${name}": - user => $destuser, - host => $desthost, - dir => $destdir, - manage_ssh_dir => $ssh_dir_manage, - ssh_dir => $ssh_dir, - authorized_keys_file => $authorized_keys_file, - installuser => $installuser, - backuptag => $backuptag, - backupkeys => $backupkeystore, - keytype => $backupkeytype, + if $sandbox { + backupninja::server::sandbox { "${user}-${name}": + user => $destuser, + host => $desthost, + dir => $destdir, + manage_ssh_dir => $ssh_dir_manage, + ssh_dir => $ssh_dir, + authorized_keys_file => $authorized_keys_file, + installuser => $installuser, + backuptag => $backuptag, + backupkeys => $backupkeystore, + keytype => $backupkeytype, + } } # the client's ssh key diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index cd73d22..294ec78 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -54,6 +54,7 @@ define backupninja::rdiff( $order = 90, $ssh_dir = "${home}/.ssh", $authorized_keys_file = 'authorized_keys', # sandbox config + $sandbox = true, $installuser = true, $backuptag = "backupninja-${::fqdn}", # monitoring @@ -68,18 +69,20 @@ define backupninja::rdiff( $order = 90, 'remote': { case $host { false: { err("need to define a host for remote backups!") } } - backupninja::server::sandbox { "${user}-${name}": - user => $user, - host => $host, - dir => $home, - manage_ssh_dir => $ssh_dir_manage, - ssh_dir => $ssh_dir, - key => $key, - authorized_keys_file => $authorized_keys_file, - installuser => $installuser, - backuptag => $backuptag, - backupkeys => $backupkeystore, - keytype => $backupkeytype, + if $sandbox { + backupninja::server::sandbox { "${user}-${name}": + user => $user, + host => $host, + dir => $home, + manage_ssh_dir => $ssh_dir_manage, + ssh_dir => $ssh_dir, + key => $key, + authorized_keys_file => $authorized_keys_file, + installuser => $installuser, + backuptag => $backuptag, + backupkeys => $backupkeystore, + keytype => $backupkeytype, + } } backupninja::key { "${user}-${name}": diff --git a/manifests/rsync.pp b/manifests/rsync.pp index a643415..56d37dd 100644 --- a/manifests/rsync.pp +++ b/manifests/rsync.pp @@ -71,6 +71,7 @@ define backupninja::rsync( $order = 90, $ssh_dir = "${home}/.ssh", $authorized_keys_file = 'authorized_keys', # sandbox config + $sandbox = true, $installuser = true, $backuptag = "backupninja-${::fqdn}", # monitoring @@ -88,18 +89,20 @@ define backupninja::rsync( $order = 90, 'remote': { case $host { false: { err("need to define a host for remote backups!") } } - backupninja::server::sandbox { "${user}-${name}": - user => $user, - host => $host, - dir => $home, - manage_ssh_dir => $ssh_dir_manage, - ssh_dir => $ssh_dir, - key => $key, - authorized_keys_file => $authorized_keys_file, - installuser => $installuser, - backuptag => $backuptag, - keytype => $backupkeytype, - backupkeys => $backupkeystore, + if $sandbox { + backupninja::server::sandbox { "${user}-${name}": + user => $user, + host => $host, + dir => $home, + manage_ssh_dir => $ssh_dir_manage, + ssh_dir => $ssh_dir, + key => $key, + authorized_keys_file => $authorized_keys_file, + installuser => $installuser, + backuptag => $backuptag, + keytype => $backupkeytype, + backupkeys => $backupkeystore, + } } backupninja::key { "${user}-${name}": -- cgit v1.2.3