aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/rdiff.pp10
-rw-r--r--manifests/server.pp21
2 files changed, 19 insertions, 12 deletions
diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp
index a4c4c05..d015d6d 100644
--- a/manifests/rdiff.pp
+++ b/manifests/rdiff.pp
@@ -23,8 +23,9 @@ define backupninja::rdiff(
"/home/*/gtk-gnutella-downloads" ],
$include = [ "/var/spool/cron/crontabs", "/var/backups", "/etc", "/root",
"/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ],
- $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $ssh_dir = false,
- $authorized_keys_file = false, $installuser = true, $installkey = true, $backuptag = false)
+ $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $manage_ssh_dir = true,
+ $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true,
+ $backuptag = false)
{
include backupninja::client
case $type {
@@ -34,8 +35,9 @@ define backupninja::rdiff(
backupninja::server::sandbox
{
"${user}-${name}": user => $user, host => $host, dir => $directory,
- ssh_dir => $ssh_dir, authorized_keys_file => $authorized_keys_file,
- installuser => $installuser, backuptag => $backuptag
+ manage_ssh_dir => $manage_ssh_dir, ssh_dir => $ssh_dir,
+ authorized_keys_file => $authorized_keys_file, installuser => $installuser,
+ backuptag => $backuptag
}
backupninja::client::key
diff --git a/manifests/server.pp b/manifests/server.pp
index 39bb5c5..ae66991 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -29,9 +29,9 @@ class backupninja::server {
# this define allows nodes to declare a remote backup sandbox, that have to
# get created on the server
define sandbox(
- $user = false, $host = false, $installuser = true, $dir = false, $ssh_dir = false,
- $authorized_keys_file = false, $backupkeys = false, $uid = false, $gid = "backupninjas",
- $backuptag = false)
+ $user = false, $host = false, $installuser = true, $dir = false, $manage_ssh_dir = true,
+ $ssh_dir = false, $authorized_keys_file = false, $backupkeys = false, $uid = false,
+ $gid = "backupninjas", $backuptag = false)
{
$real_user = $name ? {
@@ -71,12 +71,17 @@ class backupninja::server {
}
case $installuser {
true: {
- @@file { "${real_ssh_dir}":
- ensure => directory,
- mode => 700, owner => $user, group => 0,
- require => File["$real_dir"],
- tag => "$real_backuptag",
+ case $manage_ssh_dir {
+ true: {
+ @@file { "${real_ssh_dir}":
+ ensure => directory,
+ mode => 700, owner => $user, group => 0,
+ require => File["$real_dir"],
+ tag => "$real_backuptag",
+ }
+ }
}
+ }
@@file { "${real_ssh_dir}/${real_authorized_keys_file}":
ensure => present,
mode => 644, owner => 0, group => 0,