Commit 0306c8d1 authored by Micah Anderson's avatar Micah Anderson
Browse files

enable the ability to override if the ssh directory is managed or not, in

situations where there is a system-wide /etc/ssh/authorized_keys directory,
this will likely not be managed by the backupninja module, and managing
it here will result in duplicate definitions
parent 7f7101d5
...@@ -23,8 +23,9 @@ define backupninja::rdiff( ...@@ -23,8 +23,9 @@ define backupninja::rdiff(
"/home/*/gtk-gnutella-downloads" ], "/home/*/gtk-gnutella-downloads" ],
$include = [ "/var/spool/cron/crontabs", "/var/backups", "/etc", "/root", $include = [ "/var/spool/cron/crontabs", "/var/backups", "/etc", "/root",
"/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ], "/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ],
$vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $ssh_dir = false, $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $manage_ssh_dir = true,
$authorized_keys_file = false, $installuser = true, $installkey = true, $backuptag = false) $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true,
$backuptag = false)
{ {
include backupninja::client include backupninja::client
case $type { case $type {
...@@ -34,8 +35,9 @@ define backupninja::rdiff( ...@@ -34,8 +35,9 @@ define backupninja::rdiff(
backupninja::server::sandbox backupninja::server::sandbox
{ {
"${user}-${name}": user => $user, host => $host, dir => $directory, "${user}-${name}": user => $user, host => $host, dir => $directory,
ssh_dir => $ssh_dir, authorized_keys_file => $authorized_keys_file, manage_ssh_dir => $manage_ssh_dir, ssh_dir => $ssh_dir,
installuser => $installuser, backuptag => $backuptag authorized_keys_file => $authorized_keys_file, installuser => $installuser,
backuptag => $backuptag
} }
backupninja::client::key backupninja::client::key
......
...@@ -29,9 +29,9 @@ class backupninja::server { ...@@ -29,9 +29,9 @@ class backupninja::server {
# this define allows nodes to declare a remote backup sandbox, that have to # this define allows nodes to declare a remote backup sandbox, that have to
# get created on the server # get created on the server
define sandbox( define sandbox(
$user = false, $host = false, $installuser = true, $dir = false, $ssh_dir = false, $user = false, $host = false, $installuser = true, $dir = false, $manage_ssh_dir = true,
$authorized_keys_file = false, $backupkeys = false, $uid = false, $gid = "backupninjas", $ssh_dir = false, $authorized_keys_file = false, $backupkeys = false, $uid = false,
$backuptag = false) $gid = "backupninjas", $backuptag = false)
{ {
$real_user = $name ? { $real_user = $name ? {
...@@ -71,12 +71,17 @@ class backupninja::server { ...@@ -71,12 +71,17 @@ class backupninja::server {
} }
case $installuser { case $installuser {
true: { true: {
@@file { "${real_ssh_dir}": case $manage_ssh_dir {
ensure => directory, true: {
mode => 700, owner => $user, group => 0, @@file { "${real_ssh_dir}":
require => File["$real_dir"], ensure => directory,
tag => "$real_backuptag", mode => 700, owner => $user, group => 0,
require => File["$real_dir"],
tag => "$real_backuptag",
}
}
} }
}
@@file { "${real_ssh_dir}/${real_authorized_keys_file}": @@file { "${real_ssh_dir}/${real_authorized_keys_file}":
ensure => present, ensure => present,
mode => 644, owner => 0, group => 0, mode => 644, owner => 0, group => 0,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment