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

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(
"/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
......
......@@ -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,
......
Markdown is supported
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