Commit aa956a81 authored by Micah Anderson's avatar Micah Anderson

move to standardized spacing and indentation

parent 3048f4d8
......@@ -15,38 +15,43 @@
# options should be given as arrays if you want to specify multiple
# directories.
#
define backupninja::rdiff($order = 90,
$ensure = present,
$user = false,
$directory = false,
$host = false,
$type = 'local',
$exclude = [ "/home/*/.gnupg", "/home/*/.local/share/Trash", "/home/*/.Trash", "/home/*/.thumbnails", "/home/*/.beagle", "/home/*/.aMule", "/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
) {
include backupninja::client
case $type {
'remote': {
case $host { false: { err("need to define a host for remote backups!") } }
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 }
backupninja::client::key { "${user}-${name}": user => $user, host => $host, installkey => $installkey }
}
}
file { "${backupninja::client::configdir}/${order}_${name}.rdiff":
ensure => $ensure,
content => template('backupninja/rdiff.conf.erb'),
owner => root,
group => root,
mode => 0600,
require => File["${backupninja::client::configdir}"]
}
define backupninja::rdiff(
$order = 90, $ensure = present, $user = false, $directory = false, $host = false,
$type = 'local',
$exclude = [ "/home/*/.gnupg", "/home/*/.local/share/Trash", "/home/*/.Trash",
"/home/*/.thumbnails", "/home/*/.beagle", "/home/*/.aMule",
"/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)
{
include backupninja::client
case $type {
'remote': {
case $host { false: { err("need to define a host for remote backups!") } }
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
}
backupninja::client::key
{
"${user}-${name}": user => $user, host => $host,
installkey => $installkey
}
}
}
file { "${backupninja::client::configdir}/${order}_${name}.rdiff":
ensure => $ensure,
content => template('backupninja/rdiff.conf.erb'),
owner => root,
group => root,
mode => 0600,
require => File["${backupninja::client::configdir}"]
}
}
class backupninja::server {
$real_backupdir = $backupdir ? {
'' => "/backup",
default => $backupdir,
......@@ -11,21 +12,28 @@ class backupninja::server {
'' => $fqdn,
default => $backupserver_tag
}
group { "backupninjas":
ensure => "present",
gid => 700
}
file { "$real_backupdir":
ensure => "directory",
mode => 710, owner => root, group => "backupninjas"
}
User <<| tag == "backupninja-$real_backupserver_tag" |>>
File <<| tag == "backupninja-$real_backupserver_tag" |>>
# 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)
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)
{
$real_user = $name ? {
false => $name,
default => $user,
......
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