From 132bae5004456dc9fb146b35b1c6b29573fd13b6 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 3 Jan 2009 18:12:23 -0500 Subject: upgrade backupninja version to the version that will be shipped with lenny --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index c98bced..66dbd1c 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -32,7 +32,7 @@ class backupninja::client { default => $ssh_dir_manage } package { 'backupninja': - ensure => '0.9.6-3'; + ensure => '0.9.6-4'; } file { $configdir: ensure => directory -- cgit v1.2.3 From 151b7c4a46e9c766dc1b08d47ec46b0b21842578 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 9 Mar 2009 16:32:28 -0400 Subject: fix the $when default parameter to use the correct syntax If when is set to just '01:00' (as it was previously), then backups will never run due to the time format being specified incorrectly. Backupninja considers '01:00' to be the day of the week and every time it wakes up to see if it is time to do a backup it determines that it is currently not the day "01:00" and so it shouldn't do a backup now. In otherwords, it will never do a backup at this rate. I've filed a bug for this issue, because it probably should at least let you know that you've failed. https://labs.riseup.net/code/issues/show/640 --- manifests/config.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 668904e..34e3a0e 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -3,7 +3,7 @@ # write them to the config file as-is. # define backupninja::config( - $configfile = '/etc/backupninja.conf', $loglvl = 4, $when = '01:00', + $configfile = '/etc/backupninja.conf', $loglvl = 4, $when = 'everyday at 01:00', $reportemail = 'root', $reportsuccess = false, $reportwarning = true, $reporthost = $reporthost, $reportuser = $reportuser, $reportdirectory = $reportdirectory, -- cgit v1.2.3 From cb05e48d7ed052c2ddad5a0a20e0d253080675ae Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 11 Mar 2009 16:54:34 -0400 Subject: the default value for sshoptions is 'false' and this value ends up getting set into the rdiff config, so 'sshoptions = false' which results in the host attempting to connect to a hostname called 'false'. This change only includes it if the value is not 'false'. --- templates/rdiff.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/rdiff.conf.erb b/templates/rdiff.conf.erb index 0e19125..a28917a 100644 --- a/templates/rdiff.conf.erb +++ b/templates/rdiff.conf.erb @@ -33,7 +33,7 @@ type = local if VersionComparer.versioncmp(Puppet.version,'0.24.6') >= 0 %w{type host directory user sshoptions}.each do |v| - if has_variable?(v) + if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%> <%= v + ' = ' + instance_variable_get("@#{v}").to_s %> <%- -- cgit v1.2.3 From 04f10d333b4978a2ce71782c3d94fc2a08f33573 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 14 Apr 2009 15:56:53 -0400 Subject: remove the versioncmp function in the rdiff handler. This was a nice attempt to try and support older puppets, but this functionality has not stabilized yet, 0.24.8 broke versioncmp and there looks like a new way coming. Its easier to be mean. --- templates/rdiff.conf.erb | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/templates/rdiff.conf.erb b/templates/rdiff.conf.erb index a28917a..a41e969 100644 --- a/templates/rdiff.conf.erb +++ b/templates/rdiff.conf.erb @@ -28,25 +28,9 @@ type = local <% end -%> [dest] -<%- include Puppet::Util::Package - class VersionComparer; extend Puppet::Util::Package; end - - if VersionComparer.versioncmp(Puppet.version,'0.24.6') >= 0 - %w{type host directory user sshoptions}.each do |v| - if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" - -%> +<%- %w{type host directory user sshoptions}.each do |v| + if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%> <%= v + ' = ' + instance_variable_get("@#{v}").to_s %> - <%- - end - end - %> -<%- else -%> - <%- %w{type host directory user sshoptions}.each do |v| - if @scope.lookupvar(v) - -%> -<%= v + ' = ' + @scope.lookupvar(v) %> - <%- - end - end - %> -<%- end -%> +<%- + end +end -%> -- cgit v1.2.3 From fd86674685ec2b4f59cd442fcac30bc0a6d98507 Mon Sep 17 00:00:00 2001 From: drebs Date: Sun, 12 Jul 2009 16:25:21 -0300 Subject: adding duplicity configfile template. --- templates/dup.conf.erb | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 templates/dup.conf.erb diff --git a/templates/dup.conf.erb b/templates/dup.conf.erb new file mode 100644 index 0000000..1c4ccfc --- /dev/null +++ b/templates/dup.conf.erb @@ -0,0 +1,42 @@ +# This configuration file was auto-generated by the Puppet configuration +# management system. Any changes you make to this file will be overwritten +# the next time Puppet runs. Please make configuration changes to this +# service in Puppet. + +<%= 'options = ' + options if options %> +<%= 'nicelevel = ' + nicelevel if nicelevel %> +<%= 'testconnect = ' + testconnect if testconnect %> +<%= 'tmpdir = ' + tmpdir if tmpdir %> + +[gpg] +<%= 'sign = ' + sign if sign %> +<%= 'encryptkey = ' + encryptkey if encryptkey %> +<%= 'signkey = ' + signkey if signkey %> +<%= 'password = ' + password if password %> + +[source] +<% if include.is_a? String -%> +<%= 'include = ' + include %> +<% elsif include.is_a? Array -%> +<%= include.map { |i| "include = #{i}" }.join("\n") %> +<% end -%> + +<% if exclude.is_a? String -%> +<%= 'exclude = ' + exclude %> +<% elsif exclude.is_a? Array -%> +<%= exclude.map { |i| "exclude = #{i}" }.join("\n") %> +<% end -%> + +<% if vsinclude.is_a? String -%> +<%= 'vsinclude = ' + vsinclude %> +<% elsif vsinclude.is_a? Array -%> +<%= vsinclude.map { |i| "vsinclude = #{i}" }.join("\n") %> +<% end -%> + +[dest] +<%= 'incremental = ' + incremental if incremental %> +<%= 'keep = ' + keep if keep %> +<%= 'bandwithlimit = ' + bandwithlimit if bandwithlimit %> +<%= 'sshoptions = ' + sshoptions if sshoptions %> +<%= 'destdir = ' + destdir if destdir %> +<%= 'desthost = ' + desthost if desthost %> -- cgit v1.2.3 From f3faa38845cbf19292005d6911b3fddaf7589508 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Jul 2009 02:36:34 -0300 Subject: adding duplicity handler. --- manifests/dup.pp | 116 +++++++++++++++++++++++++++++++++++++++++++++++++ templates/dup.conf.erb | 1 + 2 files changed, 117 insertions(+) create mode 100644 manifests/dup.pp diff --git a/manifests/dup.pp b/manifests/dup.pp new file mode 100644 index 0000000..11fca07 --- /dev/null +++ b/manifests/dup.pp @@ -0,0 +1,116 @@ +# Run duplicity-backup as part of a backupninja run. +# +# Valid attributes for this type are: +# +# order: +# +# The prefix to give to the handler config filename, to set order in +# which the actions are executed during the backup run. +# +# ensure: +# +# Allows you to delete an entry if you don't want it any more (but be +# sure to keep the configdir, name, and order the same, so that we can +# find the correct file to remove). +# +# options, nicelevel, testconnect, tmpdir, sign, encryptkey, signkey, +# password, include, exclude, vsinclude, incremental, keep, bandwithlimit, +# sshoptions, destdir, desthost, desuser: +# +# As defined in the backupninja documentation. The options will be +# placed in the correct sections automatically. The include and +# exclude options should be given as arrays if you want to specify +# multiple directories. +# +# directory, ssh_dir_manage, ssh_dir, authorized_keys_file, installuser, +# installkey, backuptag: +# +# Options for the bakupninja::server::sandbox define, check that +# definition for more info. +# +# Some notes about this handler: +# +# - There's no support for a 'local' type in backupninja's duplicity +# handler on version 0.9.6-4, which is the version available in stable and +# testing debian repositories by the time of this writing. +define backupninja::duplicity( $order = 90, + $ensure = present, + # options to the config file + $options = false, # + $nicelevel = 0, # + $testconnect = "yes", # + $tmpdir = "/var/tmp/duplicity", # + # [gpg] + $sign = "no", + $encryptkey = false, + $signkey = false, + $password = "a_very_complicated_passphrase", + # [source] + $include = [ "/var/spool/cron/crontabs", + "/var/backups", + "/etc", + "/root", + "/home", + "/usr/local/*bin", + "/var/lib/dpkg/status*" ], + $exclude = [ "/home/*/.gnupg", + "/home/*/.local/share/Trash", + "/home/*/.Trash", + "/home/*/.thumbnails", + "/home/*/.beagle", + "/home/*/.aMule", + "/home/*/.gnupg", + "/home/*/.gpg", + "/home/*/.ssh", + "/home/*/gtk-gnutella-downloads"], + $vsinclude = false, + # [dest] + $incremental = "yes", + $keep = 60, + $bandwithlimit = "128", + $sshoptions = false, + $destdir = "/backups", + $desthost = false, + $destuser = false, + # options to backupninja's module sandbox + $ssh_dir_manage = true, + $ssh_dir = false, + $authorized_keys_file = false, + $installuser = true, + $backuptag = false, + # key options + $installkey = true ) { + include backupninja::client + + case $host { false: { err("need to define a host for remote backups!") } } + + # 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, + } + + # the client's ssh key + backupninja::client::key { "${destuser}-${name}": + user => $destuser, + host => $desthost, + installkey => $installkey, + } + + # the backupninja rule for this duplicity backup + file { "${backupninja::client::configdir}/${order}_${name}.duplicity": + ensure => $ensure, + content => template('backupninja/dup.conf.erb'), + owner => root, + group => root, + mode => 0600, + require => File["${backupninja::client::configdir}"] + } +} + diff --git a/templates/dup.conf.erb b/templates/dup.conf.erb index 1c4ccfc..ce77a5c 100644 --- a/templates/dup.conf.erb +++ b/templates/dup.conf.erb @@ -40,3 +40,4 @@ <%= 'sshoptions = ' + sshoptions if sshoptions %> <%= 'destdir = ' + destdir if destdir %> <%= 'desthost = ' + desthost if desthost %> +<%= 'destuser = ' + destuser if destuser %> -- cgit v1.2.3 From bd948b3e87fb0b16dd598ad566077fc87ff1cbe8 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Jul 2009 03:40:09 -0300 Subject: some corrections to duplicity handler. --- manifests/dup.pp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index 11fca07..610a2d0 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -62,17 +62,21 @@ define backupninja::duplicity( $order = 90, "/home/*/.gnupg", "/home/*/.gpg", "/home/*/.ssh", - "/home/*/gtk-gnutella-downloads"], + "/home/*/gtk-gnutella-downloads", + "/etc/ssh/*" ], $vsinclude = false, # [dest] $incremental = "yes", $keep = 60, - $bandwithlimit = "128", + $bandwithlimit = "0", $sshoptions = false, $destdir = "/backups", $desthost = false, $destuser = false, - # options to backupninja's module sandbox + # configs to backupninja client + $backupkeystore = false, + $backupkeytype = false, + # options to backupninja server sandbox $ssh_dir_manage = true, $ssh_dir = false, $authorized_keys_file = false, @@ -94,6 +98,7 @@ define backupninja::duplicity( $order = 90, authorized_keys_file => $authorized_keys_file, installuser => $installuser, backuptag => $backuptag, + backupkeys => $backupkeystore, } # the client's ssh key -- cgit v1.2.3 From 4c591e339655f7228b4a7d4e5632d4574dd35a99 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Jul 2009 04:13:15 -0300 Subject: eliminating some globbing because of server cache. --- manifests/init.pp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 8ed54e3..23b4268 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,5 +1,16 @@ -import "*.pp" +import "client.pp" +import "config.pp" +import "dup.pp" +import "labelmount.pp" +import "maildir.pp" +import "mysql.pp" +import "rdiff.pp" +import "server.pp" +import "sh.pp" +import "svn.pp" +import "sys.pp" class backupninja { } + -- cgit v1.2.3 From fb99850d39a75c5a24ddd15dd237682de07271d3 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Jul 2009 04:35:33 -0300 Subject: adding backup-key-type to duplicity handler. --- manifests/dup.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/dup.pp b/manifests/dup.pp index 610a2d0..0965c21 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -106,6 +106,7 @@ define backupninja::duplicity( $order = 90, user => $destuser, host => $desthost, installkey => $installkey, + keytype => $backupkeytype, } # the backupninja rule for this duplicity backup -- cgit v1.2.3 From 856beebe69dedfb23fe8a51ba7eed7846dba121a Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Jul 2009 04:46:23 -0300 Subject: adding support for keytypes in backupninja server. --- manifests/server.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 162d889..213022b 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -30,8 +30,8 @@ class backupninja::server { # get created on the server define sandbox( $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) + $ssh_dir = false, $authorized_keys_file = false, $backupkeys = false, $keytype = "rsa", + $uid = false, $gid = "backupninjas", $backuptag = false) { $real_user = $name ? { @@ -84,7 +84,7 @@ class backupninja::server { @@file { "${real_ssh_dir}/${real_authorized_keys_file}": ensure => present, mode => 0644, owner => 0, group => 0, - source => "$real_backupkeys/${user}_id_rsa.pub", + source => "$real_backupkeys/${user}_id_${keytype}.pub", require => File["${real_ssh_dir}"], tag => "$real_backuptag", } -- cgit v1.2.3 From 89853b4dcf8d93446a12527db64a5c36d3ff0a79 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Jul 2009 04:51:49 -0300 Subject: adding key type for duplicity. --- manifests/dup.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/dup.pp b/manifests/dup.pp index 0965c21..8f34b8b 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -99,6 +99,7 @@ define backupninja::duplicity( $order = 90, installuser => $installuser, backuptag => $backuptag, backupkeys => $backupkeystore, + keytype => $backupkeytype, } # the client's ssh key -- cgit v1.2.3 From 73c59d37ff9f35abf4307fd243e4ed5ec9e78d97 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Jul 2009 05:28:25 -0300 Subject: fixing file extension from ".duplicity" to ".dup". --- manifests/dup.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index 8f34b8b..170e53a 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -111,7 +111,7 @@ define backupninja::duplicity( $order = 90, } # the backupninja rule for this duplicity backup - file { "${backupninja::client::configdir}/${order}_${name}.duplicity": + file { "${backupninja::client::configdir}/${order}_${name}.dup": ensure => $ensure, content => template('backupninja/dup.conf.erb'), owner => root, -- cgit v1.2.3 From 05efcc415ed19793e10d71e95a1d412e5d2095d1 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Jul 2009 05:32:24 -0300 Subject: adding duplicity package as dependency for handler. --- manifests/dup.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/dup.pp b/manifests/dup.pp index 170e53a..05d4892 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -84,6 +84,10 @@ define backupninja::duplicity( $order = 90, $backuptag = false, # key options $installkey = true ) { + # needed packages + package { "duplicity": ensure => installed } + + # the client with configs for this machine include backupninja::client case $host { false: { err("need to define a host for remote backups!") } } -- cgit v1.2.3 From cbcacb7da154f1be8105ef69466744889b2b6c45 Mon Sep 17 00:00:00 2001 From: Matt Taggart Date: Wed, 15 Jul 2009 13:05:21 -0700 Subject: create subclasses for maildir and rdiff-backup. If you are using these features of backupninja, you'll want to switch to doing "include backupninja::client::maildir" for the machines that need it and this will pull in backupninja::client, so you don't need to include that anymore if you were explicitly doing so for those machines (although it shouldn't hurt). Right now what using these new subclasses will get you is dependencies on needed packages, but in the future there might be more. --- manifests/client.pp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/manifests/client.pp b/manifests/client.pp index 66dbd1c..999108c 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -86,4 +86,28 @@ class backupninja::client { } } +class backupninja::client::maildir inherits backupninja::client { + case $rsync_ensure_version { + '': { $rsync_ensure_version = "present" } + } + if !defined(Package["rsync"]) { + if $rsync_ensure_version == '' { $rsync_ensure_version = 'installed' } + package { 'rsync': + ensure => $rsync_ensure_version, + } + } +} + +class backupninja::client::rdiff-backup inherits backupninja::client { + case $rdiff-backup_ensure_version { + '': { $rdiff-backup_ensure_version = "present" } + } + + if !defined(Package["rdiff-backup"]) { + if $rdiff-backup_ensure_version == '' { $rdiff-backup_ensure_version = 'installed' } + package { 'rdiff-backup': + ensure => $rdiff-backup_ensure_version, + } + } +} -- cgit v1.2.3 From 00d3218d1ced516b6cb555155a631c0071d46d80 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 15 Jul 2009 17:10:21 -0400 Subject: remove redundant case statements which tested to see if the package ensure version variables were set changed the $rdiff-backup_ensure_version variable to $rdiff_backup_ensure_version as dashes are not allowed in variable names --- manifests/client.pp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 999108c..d799014 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -87,9 +87,6 @@ class backupninja::client { } class backupninja::client::maildir inherits backupninja::client { - case $rsync_ensure_version { - '': { $rsync_ensure_version = "present" } - } if !defined(Package["rsync"]) { if $rsync_ensure_version == '' { $rsync_ensure_version = 'installed' } @@ -100,14 +97,11 @@ class backupninja::client::maildir inherits backupninja::client { } class backupninja::client::rdiff-backup inherits backupninja::client { - case $rdiff-backup_ensure_version { - '': { $rdiff-backup_ensure_version = "present" } - } if !defined(Package["rdiff-backup"]) { - if $rdiff-backup_ensure_version == '' { $rdiff-backup_ensure_version = 'installed' } + if $rdiff_backup_ensure_version == '' { $rdiff_backup_ensure_version = 'installed' } package { 'rdiff-backup': - ensure => $rdiff-backup_ensure_version, + ensure => $rdiff_backup_ensure_version, } } } -- cgit v1.2.3 From d5acd326fc1454874a59b83a17e2621be7245ea9 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 15 Jul 2009 17:13:44 -0400 Subject: fix rdiff-backup class name, "You can use Aa-Zz, 0-9 and underscores in variables, resources and class names." which means no dashes in class names either --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index d799014..a3d2242 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -96,7 +96,7 @@ class backupninja::client::maildir inherits backupninja::client { } } -class backupninja::client::rdiff-backup inherits backupninja::client { +class backupninja::client::rdiff_backup inherits backupninja::client { if !defined(Package["rdiff-backup"]) { if $rdiff_backup_ensure_version == '' { $rdiff_backup_ensure_version = 'installed' } -- cgit v1.2.3 From 0b9d05cf596fab6b8fe4b03e21e6f8cb802238fe Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 15 Jul 2009 17:17:05 -0400 Subject: add some details to the README about the package installation options --- README | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README b/README index bf4eb49..4fc5c34 100644 --- a/README +++ b/README @@ -20,6 +20,7 @@ backupninja::mysql { all_databases: sqldump => true } +include backupninja::client::rdiff_backup backupninja::rdiff { backup_all: directory => '/media/backupdisk', include => ['/var/backups', '/home', '/var/lib/dpkg/status'], @@ -35,6 +36,16 @@ A remote rdiff backup handler: user => "backup-$hostname", } +If you include the backupninja::client::rdiff_backup class, you will +get the rdiff-backup package installed automatically, this also works +for the backupninja::client::maildir class (installs needed rsync package) + +If you need to specify a specific version of the rdiff-backup, or rsync package, you can do so +by specifying the variables: + +$rdiff_backup_ensure_version = "1.2.5-1~bpo40+1" +$rsync_ensure_version = "3.0.6-1~bpo50+1" + If you configure a backupninja::server, it will collect those users and create them. We have yet to create proper authorized_keys management to make that process completely automatic. -- cgit v1.2.3 From bc167339c62ad2e06c8cdcd298364f20afa04658 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 16 Jul 2009 18:23:05 -0300 Subject: Checking whether an exported resource is defined Checking whether an exported resource is already defined at backupninja::server::sandbox, otherwise puppet will try to redefined them each time a backup resource type is invoked with the same arguments (such as $directory), raising an error. --- manifests/server.pp | 84 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 213022b..fa85492 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -63,57 +63,67 @@ class backupninja::server { false => "backupninja-$real_host", default => $backuptag, } - - @@file { "$real_dir": - ensure => directory, - mode => 0750, owner => $user, group => 0, - tag => "$real_backuptag", + + if !defined(File["$real_dir"]) { + @@file { "$real_dir": + ensure => directory, + mode => 0750, owner => $user, group => 0, + tag => "$real_backuptag", + } } case $installuser { true: { case $manage_ssh_dir { true: { - @@file { "${real_ssh_dir}": - ensure => directory, - mode => 0700, owner => $user, group => 0, - require => File["$real_dir"], - tag => "$real_backuptag", + if !defined(File["$real_ssh_dir"]) { + @@file { "${real_ssh_dir}": + ensure => directory, + mode => 0700, owner => $user, group => 0, + require => File["$real_dir"], + tag => "$real_backuptag", + } } } } - @@file { "${real_ssh_dir}/${real_authorized_keys_file}": - ensure => present, - mode => 0644, owner => 0, group => 0, - source => "$real_backupkeys/${user}_id_${keytype}.pub", - require => File["${real_ssh_dir}"], - tag => "$real_backuptag", + if !defined(File["$real_ssh_dir"]) { + @@file { "${real_ssh_dir}/${real_authorized_keys_file}": + ensure => present, + mode => 0644, owner => 0, group => 0, + source => "$real_backupkeys/${user}_id_${keytype}.pub", + require => File["${real_ssh_dir}"], + tag => "$real_backuptag", + } } case $uid { false: { - @@user { "$user": - ensure => "present", - gid => "$gid", - comment => "$name backup sandbox", - home => "$real_dir", - managehome => true, - shell => "/bin/sh", - password => '*', - require => Group['backupninjas'], - tag => "$real_backuptag" + if !defined(File["$real_ssh_dir"]) { + @@user { "$user": + ensure => "present", + gid => "$gid", + comment => "$name backup sandbox", + home => "$real_dir", + managehome => true, + shell => "/bin/sh", + password => '*', + require => Group['backupninjas'], + tag => "$real_backuptag" + } } } default: { - @@user { "$user": - ensure => "present", - uid => "$uid", - gid => "$gid", - comment => "$name backup sandbox", - home => "$real_dir", - managehome => true, - shell => "/bin/sh", - password => '*', - require => Group['backupninjas'], - tag => "$real_backuptag" + if !defined(File["$real_ssh_dir"]) { + @@user { "$user": + ensure => "present", + uid => "$uid", + gid => "$gid", + comment => "$name backup sandbox", + home => "$real_dir", + managehome => true, + shell => "/bin/sh", + password => '*', + require => Group['backupninjas'], + tag => "$real_backuptag" + } } } } -- cgit v1.2.3 From c80b8348d7b3befb9cff496bb0443a0d05385b26 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 21:07:40 -0300 Subject: Add rdiff::backup option to config dest user home folder --- manifests/rdiff.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index e3964d0..ec89006 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -25,7 +25,7 @@ define backupninja::rdiff( "/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ], $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $ssh_dir_manage = true, $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true, - $backuptag = false) + $backuptag = false, $home = false) { include backupninja::client case $type { @@ -34,7 +34,11 @@ define backupninja::rdiff( backupninja::server::sandbox { - "${user}-${name}": user => $user, host => $host, dir => $directory, + $real_home = $home ? { + false => $directory, + default => $home, + } + "${user}-${name}": user => $user, host => $host, dir => $real_home, manage_ssh_dir => $ssh_dir_manage, ssh_dir => $ssh_dir, authorized_keys_file => $authorized_keys_file, installuser => $installuser, backuptag => $backuptag -- cgit v1.2.3 From e0982845a5781c542ac3efa3b8c7d6b7f7db8087 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 21:14:07 -0300 Subject: Oops --- manifests/rdiff.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index ec89006..b1dd7d2 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -32,12 +32,13 @@ define backupninja::rdiff( 'remote': { case $host { false: { err("need to define a host for remote backups!") } } + $real_home = $home ? { + false => $directory, + default => $home, + } + backupninja::server::sandbox { - $real_home = $home ? { - false => $directory, - default => $home, - } "${user}-${name}": user => $user, host => $host, dir => $real_home, manage_ssh_dir => $ssh_dir_manage, ssh_dir => $ssh_dir, authorized_keys_file => $authorized_keys_file, installuser => $installuser, -- cgit v1.2.3 From 30237b7ed066509b53bc1f53ffe797d9041856db Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 21:37:43 -0300 Subject: Fixing some definitions at backupninja::server::sandbox --- manifests/server.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index fa85492..28b97d5 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -85,7 +85,7 @@ class backupninja::server { } } } - if !defined(File["$real_ssh_dir"]) { + if !defined(File["${real_ssh_dir}/${real_authorized_keys_file}"]) { @@file { "${real_ssh_dir}/${real_authorized_keys_file}": ensure => present, mode => 0644, owner => 0, group => 0, @@ -96,7 +96,7 @@ class backupninja::server { } case $uid { false: { - if !defined(File["$real_ssh_dir"]) { + if !defined(File["$real_user"]) { @@user { "$user": ensure => "present", gid => "$gid", @@ -111,8 +111,8 @@ class backupninja::server { } } default: { - if !defined(File["$real_ssh_dir"]) { - @@user { "$user": + if !defined(File["$real_user"]) { + @@user { "$real_user": ensure => "present", uid => "$uid", gid => "$gid", -- cgit v1.2.3 From 02d8a40959f4376742d6c813aa3e44e79c56c429 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 21:54:25 -0300 Subject: Fixing some definitions at backupninja::server::sandbox (2) --- manifests/server.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 28b97d5..790c931 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -96,8 +96,8 @@ class backupninja::server { } case $uid { false: { - if !defined(File["$real_user"]) { - @@user { "$user": + if !defined(User["$real_user"]) { + @@user { "$real_user": ensure => "present", gid => "$gid", comment => "$name backup sandbox", @@ -111,7 +111,7 @@ class backupninja::server { } } default: { - if !defined(File["$real_user"]) { + if !defined(User["$real_user"]) { @@user { "$real_user": ensure => "present", uid => "$uid", -- cgit v1.2.3 From 564244547ab684e9b63d48fcabbe4f6d377d022e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 22:29:24 -0300 Subject: Adding backupkeytype parameter at backupninja::rdiff --- manifests/rdiff.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index b1dd7d2..a8956f3 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -25,7 +25,7 @@ define backupninja::rdiff( "/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ], $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $ssh_dir_manage = true, $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true, - $backuptag = false, $home = false) + $backuptag = false, $home = false, $backupkeytype = false) { include backupninja::client case $type { @@ -42,7 +42,7 @@ define backupninja::rdiff( "${user}-${name}": user => $user, host => $host, dir => $real_home, manage_ssh_dir => $ssh_dir_manage, ssh_dir => $ssh_dir, authorized_keys_file => $authorized_keys_file, installuser => $installuser, - backuptag => $backuptag + backuptag => $backuptag, keytype => $backupkeytype, } backupninja::client::key -- cgit v1.2.3 From 618cddaaeb0a89d3f01f359ebcb80be9d95264da Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 22:40:24 -0300 Subject: Setting the right default value for backupkeytype --- manifests/dup.pp | 2 +- manifests/rdiff.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index 05d4892..f12fc0f 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -75,7 +75,7 @@ define backupninja::duplicity( $order = 90, $destuser = false, # configs to backupninja client $backupkeystore = false, - $backupkeytype = false, + $backupkeytype = '', # options to backupninja server sandbox $ssh_dir_manage = true, $ssh_dir = false, diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index a8956f3..579071b 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -25,7 +25,7 @@ define backupninja::rdiff( "/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ], $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $ssh_dir_manage = true, $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true, - $backuptag = false, $home = false, $backupkeytype = false) + $backuptag = false, $home = false, $backupkeytype = '') { include backupninja::client case $type { -- cgit v1.2.3 From 6734c256525e1dd42ba3648db82083bcabca66ed Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 22:48:57 -0300 Subject: Avoiding duplicate file definitions at backupninja::client::key --- manifests/client.pp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index a3d2242..8368eb4 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -72,14 +72,18 @@ class backupninja::client { case $install_key { true: { - file { "${backupninja::client::real_keydestination}": - ensure => directory, - mode => 0700, owner => $key_owner, group => $key_group, + if !defined(File["${backupninja::client::real_keydestination}"]) { + file { "${backupninja::client::real_keydestination}": + ensure => directory, + mode => 0700, owner => $key_owner, group => $key_group, + } } - file { "${backupninja::client::real_keydestination}/id_${key_type}": - source => "${key_store}/${real_user}_id_${key_type}", - mode => 0400, owner => $key_owner, group => $key_group, - require => File["${backupninja::client::real_keydestination}"], + if !defined(File["${backupninja::client::real_keydestination/id_${key_type}"]) { + file { "${backupninja::client::real_keydestination}/id_${key_type}": + source => "${key_store}/${real_user}_id_${key_type}", + mode => 0400, owner => $key_owner, group => $key_group, + require => File["${backupninja::client::real_keydestination}"], + } } } } -- cgit v1.2.3 From d162c8429284b2dd18f90c23095935b35cc0106c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 27 Aug 2009 13:20:38 -0300 Subject: Trying to avoid duplicate definition of backupninja::client::key on backupninja::rdiff --- manifests/rdiff.pp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index 579071b..2eb1d9b 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -44,11 +44,13 @@ define backupninja::rdiff( authorized_keys_file => $authorized_keys_file, installuser => $installuser, backuptag => $backuptag, keytype => $backupkeytype, } - - backupninja::client::key - { - "${user}-${name}": user => $user, host => $host, - installkey => $installkey + + if !defined(Backupninja::client::key["${user}-${name}"]) { + backupninja::client::key + { + "${user}-${name}": user => $user, host => $host, + installkey => $installkey + } } } } -- cgit v1.2.3 From a7c710bda474a08a8902978069bcc3227ba5f223 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 27 Aug 2009 15:43:52 -0400 Subject: * add duplicity package management class to the client class * update the README to be more clear about how this works, provide more examples and included details about the addition of the backupninja::client::duplicity class --- README | 34 ++++++++++++++++++++++++---------- manifests/client.pp | 11 +++++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/README b/README index 4fc5c34..3b73200 100644 --- a/README +++ b/README @@ -36,19 +36,33 @@ A remote rdiff backup handler: user => "backup-$hostname", } -If you include the backupninja::client::rdiff_backup class, you will -get the rdiff-backup package installed automatically, this also works -for the backupninja::client::maildir class (installs needed rsync package) +To manage the installed backup software, using puppet package +management, you can include the backupninja::client::$backupprogram +class (where $backupprogram is one of: rdiff_backup, maildir, +duplicity). This will get the $backupprogram package installed +automatically, you do not need to include this class, if you wish to +manage the package version some other way, for example: -If you need to specify a specific version of the rdiff-backup, or rsync package, you can do so -by specifying the variables: +include backupninja::client::rdiff_backup +include backupninja::client::maildir +include backupninja::client::duplicity + +When this class is included, it will make sure that the correct +version that is associated with puppet's 'installed' (or 'present') +parameter is installed. If you need to specify a specific version of +the rdiff-backup, rsync or duplicity packages, you can do so by +specifying the variables: $rdiff_backup_ensure_version = "1.2.5-1~bpo40+1" $rsync_ensure_version = "3.0.6-1~bpo50+1" +$duplicity_ensure_version = "0.6.04-1~bpo50+1" + +If you do not specify these variables the default 'installed/present' +version will be installed when you include this class. -If you configure a backupninja::server, it will collect those users and create -them. We have yet to create proper authorized_keys management to make that -process completely automatic. +If you configure a backupninja::server, it will collect those users +and create them. We have yet to create proper authorized_keys +management to make that process completely automatic. -At the moment, not all the backupninja handlers are available, they are relatively -easy to add however. \ No newline at end of file +At the moment, not all the backupninja handlers are available, they +are relatively easy to add however. \ No newline at end of file diff --git a/manifests/client.pp b/manifests/client.pp index a3d2242..ef449f5 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -105,3 +105,14 @@ class backupninja::client::rdiff_backup inherits backupninja::client { } } } + +class backupninja::client::duplicity inherits backupninja::client { + + if !defined(Package["duplicity"]) { + if $duplicity_ensure_version == '' { $duplicity_ensure_version = 'installed' } + package { 'duplicity': + ensure => $duplicity_ensure_version, + } + } +} + -- cgit v1.2.3 From d890916504b8fe282392f0a1cddc58f12a0e983b Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 27 Aug 2009 15:47:03 -0400 Subject: add in comment from 05efcc415ed19793e10d71e95a1d412e5d2095d1, didn't merge this commit, because it also includes the package installation bits that we are doing a different way --- manifests/dup.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/dup.pp b/manifests/dup.pp index 170e53a..61491c6 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -84,6 +84,8 @@ define backupninja::duplicity( $order = 90, $backuptag = false, # key options $installkey = true ) { + + # the client with configs for this machine include backupninja::client case $host { false: { err("need to define a host for remote backups!") } } -- cgit v1.2.3 From 0d6a2ec42949af1c08c673fe2dc1cad7973d7649 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 16 Jul 2009 18:23:05 -0300 Subject: Checking whether an exported resource is defined Checking whether an exported resource is already defined at backupninja::server::sandbox, otherwise puppet will try to redefined them each time a backup resource type is invoked with the same arguments (such as $directory), raising an error. --- manifests/server.pp | 84 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 213022b..fa85492 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -63,57 +63,67 @@ class backupninja::server { false => "backupninja-$real_host", default => $backuptag, } - - @@file { "$real_dir": - ensure => directory, - mode => 0750, owner => $user, group => 0, - tag => "$real_backuptag", + + if !defined(File["$real_dir"]) { + @@file { "$real_dir": + ensure => directory, + mode => 0750, owner => $user, group => 0, + tag => "$real_backuptag", + } } case $installuser { true: { case $manage_ssh_dir { true: { - @@file { "${real_ssh_dir}": - ensure => directory, - mode => 0700, owner => $user, group => 0, - require => File["$real_dir"], - tag => "$real_backuptag", + if !defined(File["$real_ssh_dir"]) { + @@file { "${real_ssh_dir}": + ensure => directory, + mode => 0700, owner => $user, group => 0, + require => File["$real_dir"], + tag => "$real_backuptag", + } } } } - @@file { "${real_ssh_dir}/${real_authorized_keys_file}": - ensure => present, - mode => 0644, owner => 0, group => 0, - source => "$real_backupkeys/${user}_id_${keytype}.pub", - require => File["${real_ssh_dir}"], - tag => "$real_backuptag", + if !defined(File["$real_ssh_dir"]) { + @@file { "${real_ssh_dir}/${real_authorized_keys_file}": + ensure => present, + mode => 0644, owner => 0, group => 0, + source => "$real_backupkeys/${user}_id_${keytype}.pub", + require => File["${real_ssh_dir}"], + tag => "$real_backuptag", + } } case $uid { false: { - @@user { "$user": - ensure => "present", - gid => "$gid", - comment => "$name backup sandbox", - home => "$real_dir", - managehome => true, - shell => "/bin/sh", - password => '*', - require => Group['backupninjas'], - tag => "$real_backuptag" + if !defined(File["$real_ssh_dir"]) { + @@user { "$user": + ensure => "present", + gid => "$gid", + comment => "$name backup sandbox", + home => "$real_dir", + managehome => true, + shell => "/bin/sh", + password => '*', + require => Group['backupninjas'], + tag => "$real_backuptag" + } } } default: { - @@user { "$user": - ensure => "present", - uid => "$uid", - gid => "$gid", - comment => "$name backup sandbox", - home => "$real_dir", - managehome => true, - shell => "/bin/sh", - password => '*', - require => Group['backupninjas'], - tag => "$real_backuptag" + if !defined(File["$real_ssh_dir"]) { + @@user { "$user": + ensure => "present", + uid => "$uid", + gid => "$gid", + comment => "$name backup sandbox", + home => "$real_dir", + managehome => true, + shell => "/bin/sh", + password => '*', + require => Group['backupninjas'], + tag => "$real_backuptag" + } } } } -- cgit v1.2.3 From 3b2c88b24b73a6c31e6b5bc5de6108108d4a276c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 21:37:43 -0300 Subject: Fixing some definitions at backupninja::server::sandbox --- manifests/server.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index fa85492..28b97d5 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -85,7 +85,7 @@ class backupninja::server { } } } - if !defined(File["$real_ssh_dir"]) { + if !defined(File["${real_ssh_dir}/${real_authorized_keys_file}"]) { @@file { "${real_ssh_dir}/${real_authorized_keys_file}": ensure => present, mode => 0644, owner => 0, group => 0, @@ -96,7 +96,7 @@ class backupninja::server { } case $uid { false: { - if !defined(File["$real_ssh_dir"]) { + if !defined(File["$real_user"]) { @@user { "$user": ensure => "present", gid => "$gid", @@ -111,8 +111,8 @@ class backupninja::server { } } default: { - if !defined(File["$real_ssh_dir"]) { - @@user { "$user": + if !defined(File["$real_user"]) { + @@user { "$real_user": ensure => "present", uid => "$uid", gid => "$gid", -- cgit v1.2.3 From c533d7aa3a2b95049fa625da9182854f3a2f5e53 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 26 Aug 2009 21:54:25 -0300 Subject: Fixing some definitions at backupninja::server::sandbox (2) --- manifests/server.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 28b97d5..790c931 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -96,8 +96,8 @@ class backupninja::server { } case $uid { false: { - if !defined(File["$real_user"]) { - @@user { "$user": + if !defined(User["$real_user"]) { + @@user { "$real_user": ensure => "present", gid => "$gid", comment => "$name backup sandbox", @@ -111,7 +111,7 @@ class backupninja::server { } } default: { - if !defined(File["$real_user"]) { + if !defined(User["$real_user"]) { @@user { "$real_user": ensure => "present", uid => "$uid", -- cgit v1.2.3 From 264f3ef1216d1e1e4ab0171e7b503bbb8c4658e1 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 27 Aug 2009 16:28:30 -0400 Subject: remove some stray comments --- manifests/dup.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index 61491c6..26514ad 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -36,10 +36,10 @@ define backupninja::duplicity( $order = 90, $ensure = present, # options to the config file - $options = false, # - $nicelevel = 0, # - $testconnect = "yes", # - $tmpdir = "/var/tmp/duplicity", # + $options = false, + $nicelevel = 0, + $testconnect = "yes", + $tmpdir = "/var/tmp/duplicity", # [gpg] $sign = "no", $encryptkey = false, -- cgit v1.2.3 From 1ec565f20a431ab8b44d655cb59ab01706b5312f Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 27 Aug 2009 17:05:36 -0400 Subject: I unset the duplicity options that are set by default by backupninja already (it is unecessary to set them when they are already set to the defaults): testconnect, sign, keep, bandwidthlimit I also unset because they were not set to the defaults: $tmpdir = "/var/tmp/duplicity", $nicelevel = 19. The defaults for these are: $tmpdir = "/tmp", and $nicelevel = 0. The example configuration files included in backupninja are confusing about these, so I've just clarified those in the upstream source. Then there were a couple options that were set to values that I think should not be set: $password = "a_very_complicated_passphrase" -- I dont think this should be set by default at all, because people will accidentally use this passphrase by default (yuck). People should be forced to set this. I also reset the $destdir = "/backups" setting to be false. This value must be set, but I dont think it should be set by default. --- manifests/dup.pp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index 26514ad..afcdab2 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -37,14 +37,14 @@ define backupninja::duplicity( $order = 90, $ensure = present, # options to the config file $options = false, - $nicelevel = 0, - $testconnect = "yes", - $tmpdir = "/var/tmp/duplicity", + $nicelevel = false, + $testconnect = false, + $tmpdir = false, # [gpg] - $sign = "no", + $sign = false, $encryptkey = false, $signkey = false, - $password = "a_very_complicated_passphrase", + $password = false, # [source] $include = [ "/var/spool/cron/crontabs", "/var/backups", @@ -67,10 +67,10 @@ define backupninja::duplicity( $order = 90, $vsinclude = false, # [dest] $incremental = "yes", - $keep = 60, - $bandwithlimit = "0", + $keep = false, + $bandwithlimit = false, $sshoptions = false, - $destdir = "/backups", + $destdir = false, $desthost = false, $destuser = false, # configs to backupninja client -- cgit v1.2.3 From aaa46561012ac8ab6070f8cd53a111346c586f5f Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 27 Aug 2009 17:10:56 -0400 Subject: fix the $desthost variable requirement, was incorrectly set to $host add a $destdir variable requirement --- manifests/dup.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index afcdab2..f734e5d 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -88,7 +88,8 @@ define backupninja::duplicity( $order = 90, # the client with configs for this machine include backupninja::client - case $host { false: { err("need to define a host for remote backups!") } } + case $desthost { false: { err("need to define a destination host for remote backups!") } } + case $destdir { false: { err("need to define a destination directory for remote backups!") } } # guarantees there's a configured backup space for this backup backupninja::server::sandbox { "${user}-${name}": -- cgit v1.2.3 From e8b238bf014cefd1f4077b9d96113cf0463ab3b4 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 27 Aug 2009 17:13:11 -0400 Subject: set a requirement that the rdiff-backup directory variable must be set --- manifests/rdiff.pp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index e3964d0..1207cb1 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -28,6 +28,9 @@ define backupninja::rdiff( $backuptag = false) { include backupninja::client + + case $directory { false: { err("need to define a directory for where the backups should go!") } } + case $type { 'remote': { case $host { false: { err("need to define a host for remote backups!") } } -- cgit v1.2.3 From 4c1bf41b5a0b7969043dd480f903d403d16c6994 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 27 Aug 2009 17:19:20 -0400 Subject: the $password variable also must be set, so spit an error if it is not defined --- manifests/dup.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/dup.pp b/manifests/dup.pp index f734e5d..ca996b8 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -90,6 +90,7 @@ define backupninja::duplicity( $order = 90, case $desthost { false: { err("need to define a destination host for remote backups!") } } case $destdir { false: { err("need to define a destination directory for remote backups!") } } + 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}": -- cgit v1.2.3 From 8c72b1b43a428ccebb2b629ed60f06ff71650c17 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 27 Aug 2009 17:49:26 -0400 Subject: add a note about the password variable needing to be enclosed in single quotes --- manifests/dup.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/dup.pp b/manifests/dup.pp index ca996b8..c4554ee 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -30,6 +30,10 @@ # # Some notes about this handler: # +# - When specifying a password, be sure to enclose it in single quotes, +# this is particularly important if you have any special characters, such +# as a $ which puppet will attempt to interpret resulting in a different +# password placed in the file than you expect! # - There's no support for a 'local' type in backupninja's duplicity # handler on version 0.9.6-4, which is the version available in stable and # testing debian repositories by the time of this writing. -- cgit v1.2.3 From 3262942cba7b324e7c23756ef026e28053acfa95 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 27 Aug 2009 21:08:54 -0300 Subject: Removing wrong defined() call --- manifests/rdiff.pp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index d34fc88..55aa382 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -48,12 +48,10 @@ define backupninja::rdiff( backuptag => $backuptag, keytype => $backupkeytype, } - if !defined(Backupninja::client::key["${user}-${name}"]) { - backupninja::client::key - { - "${user}-${name}": user => $user, host => $host, - installkey => $installkey - } + backupninja::client::key + { + "${user}-${name}": user => $user, host => $host, + installkey => $installkey } } } -- cgit v1.2.3 From 51fa752d2f4f8e68c933483c8c772181de96f4bf Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 27 Aug 2009 21:16:45 -0300 Subject: Making backupkeytype = false by default to avoided blank keytype --- manifests/dup.pp | 2 +- manifests/rdiff.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index 5e58c2b..c4554ee 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -79,7 +79,7 @@ define backupninja::duplicity( $order = 90, $destuser = false, # configs to backupninja client $backupkeystore = false, - $backupkeytype = '', + $backupkeytype = false, # options to backupninja server sandbox $ssh_dir_manage = true, $ssh_dir = false, diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index 55aa382..9348b42 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -25,7 +25,7 @@ define backupninja::rdiff( "/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ], $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $ssh_dir_manage = true, $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true, - $backuptag = false, $home = false, $backupkeytype = '') + $backuptag = false, $home = false, $backupkeytype = false) { include backupninja::client -- cgit v1.2.3 From 7a77206c6003835f45a3a07ecb4a7f29af29d9d0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 27 Aug 2009 21:30:21 -0300 Subject: Adding additional clause to avoid blank keytype --- manifests/client.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/client.pp b/manifests/client.pp index c3d186d..04001e7 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -66,6 +66,7 @@ class backupninja::client { default => $keystore, } $key_type = $keytype ? { + '' => "${backupninja::client::real_keytype}", false => "${backupninja::client::real_keytype}", default => $keytype, } -- cgit v1.2.3 From 31414022aba5918ba5678e27e362bf134848dbe1 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 27 Aug 2009 21:45:04 -0300 Subject: Adding additional clause to avoid blank real_keytype --- manifests/client.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 04001e7..fa64510 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -8,7 +8,8 @@ class backupninja::client { default => $backupkeystore, } $real_keytype = $backupkeytype ? { - '' => 'rsa', + '' => 'rsa', + false => 'rsa', default => $backupkeytype, } $real_keydestination = $keydestination ? { -- cgit v1.2.3 From f96267fe354a9df417afdc09899c58edf3e67d24 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 27 Aug 2009 22:08:50 -0300 Subject: Defaulting backupkeytype to 'rsa' --- manifests/dup.pp | 2 +- manifests/rdiff.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index c4554ee..411a44d 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -79,7 +79,7 @@ define backupninja::duplicity( $order = 90, $destuser = false, # configs to backupninja client $backupkeystore = false, - $backupkeytype = false, + $backupkeytype = "rsa", # options to backupninja server sandbox $ssh_dir_manage = true, $ssh_dir = false, diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index 9348b42..904c68f 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -25,7 +25,7 @@ define backupninja::rdiff( "/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ], $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $ssh_dir_manage = true, $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true, - $backuptag = false, $home = false, $backupkeytype = false) + $backuptag = false, $home = false, $backupkeytype = "rsa") { include backupninja::client -- cgit v1.2.3 From b432d94fa72162aa9635217b703ad100b9d39fa2 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 28 Aug 2009 17:17:25 -0300 Subject: New backupninja::client::defaults to avoid duplicates. Adding part of client.pp code into new class backupninja::client::defaults in an attempt to avoid duplicate definitions inside backupninja::client::key. --- manifests/client.pp | 33 ++++++++++++++++++--------------- manifests/dup.pp | 6 +++--- manifests/labelmount.pp | 10 +++++----- manifests/maildir.pp | 6 +++--- manifests/mysql.pp | 6 +++--- manifests/rdiff.pp | 6 +++--- manifests/sh.pp | 6 +++--- manifests/svn.pp | 6 +++--- manifests/sys.pp | 6 +++--- 9 files changed, 44 insertions(+), 41 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index fa64510..f8c5e23 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,4 +1,4 @@ -class backupninja::client { +class backupninja::client::defaults { $configdir = $cfg_override ? { '' => "/etc/backup.d", default => $cfg_override, @@ -38,6 +38,9 @@ class backupninja::client { file { $configdir: ensure => directory } +} + +class backupninja::client inherits backupninja::client::defaults { define key( $user = false, $host = false, $installkey=false, $keyowner=false, $keygroup=false, $keystore=false, $keytype=false) @@ -51,40 +54,40 @@ class backupninja::client { default => $host } $install_key = $installkey ? { - false => "${backupninja::client::real_keymanage}", + false => "${backupninja::client::defaults::real_keymanage}", default => $installkey, } $key_owner = $keyowner ? { - false => "${backupninja::client::real_keyowner}", + false => "${backupninja::client::defaults::real_keyowner}", default => $keyowner, } $key_group = $keygroup ? { - false => "${backupninja::client::real_keygroup}", + false => "${backupninja::client::defaults::real_keygroup}", default => $keygroup, } $key_store = $keystore ? { - false => "${backupninja::client::real_keystore}", + false => "${backupninja::client::defaults::real_keystore}", default => $keystore, } $key_type = $keytype ? { - '' => "${backupninja::client::real_keytype}", - false => "${backupninja::client::real_keytype}", + '' => "${backupninja::client::defaults::real_keytype}", + false => "${backupninja::client::defaults::real_keytype}", default => $keytype, } case $install_key { true: { - if !defined(File["${backupninja::client::real_keydestination}"]) { - file { "${backupninja::client::real_keydestination}": + if !defined(File["${backupninja::client::defaults::real_keydestination}"]) { + file { "${backupninja::client::defaults::real_keydestination}": ensure => directory, mode => 0700, owner => $key_owner, group => $key_group, } } - if !defined(File["${backupninja::client::real_keydestination/id_${key_type}"]) { - file { "${backupninja::client::real_keydestination}/id_${key_type}": + if !defined(File["${backupninja::client::defaults::real_keydestination/id_${key_type}"]) { + file { "${backupninja::client::defaults::real_keydestination}/id_${key_type}": source => "${key_store}/${real_user}_id_${key_type}", mode => 0400, owner => $key_owner, group => $key_group, - require => File["${backupninja::client::real_keydestination}"], + require => File["${backupninja::client::defaults::real_keydestination}"], } } } @@ -92,7 +95,7 @@ class backupninja::client { } } -class backupninja::client::maildir inherits backupninja::client { +class backupninja::client::maildir inherits backupninja::client::defaults { if !defined(Package["rsync"]) { if $rsync_ensure_version == '' { $rsync_ensure_version = 'installed' } @@ -102,7 +105,7 @@ class backupninja::client::maildir inherits backupninja::client { } } -class backupninja::client::rdiff_backup inherits backupninja::client { +class backupninja::client::rdiff_backup inherits backupninja::client::defaults { if !defined(Package["rdiff-backup"]) { if $rdiff_backup_ensure_version == '' { $rdiff_backup_ensure_version = 'installed' } @@ -112,7 +115,7 @@ class backupninja::client::rdiff_backup inherits backupninja::client { } } -class backupninja::client::duplicity inherits backupninja::client { +class backupninja::client::duplicity inherits backupninja::client::defaults { if !defined(Package["duplicity"]) { if $duplicity_ensure_version == '' { $duplicity_ensure_version = 'installed' } diff --git a/manifests/dup.pp b/manifests/dup.pp index 411a44d..6e0330a 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -90,7 +90,7 @@ define backupninja::duplicity( $order = 90, $installkey = true ) { # the client with configs for this machine - include backupninja::client + include backupninja::client::defaults case $desthost { false: { err("need to define a destination host for remote backups!") } } case $destdir { false: { err("need to define a destination directory for remote backups!") } } @@ -119,13 +119,13 @@ define backupninja::duplicity( $order = 90, } # the backupninja rule for this duplicity backup - file { "${backupninja::client::configdir}/${order}_${name}.dup": + file { "${backupninja::client::defaults::configdir}/${order}_${name}.dup": ensure => $ensure, content => template('backupninja/dup.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } } diff --git a/manifests/labelmount.pp b/manifests/labelmount.pp index d9158c4..6b1f772 100644 --- a/manifests/labelmount.pp +++ b/manifests/labelmount.pp @@ -23,23 +23,23 @@ define backupninja::labelmount($order = 10, $label, $dest ) { - include backupninja::client - file { "${backupninja::client::configdir}/${order}_${name}.labelmount": + include backupninja::client::defaults + file { "${backupninja::client::defaults::configdir}/${order}_${name}.labelmount": ensure => $ensure, content => template('backupninja/labelmount.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } - file { "${backupninja::client::configdir}/99_${name}.umount": + file { "${backupninja::client::defaults::configdir}/99_${name}.umount": ensure => $ensure, content => template('backupninja/umount.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } # Copy over the handler scripts themselves, since they're not in the diff --git a/manifests/maildir.pp b/manifests/maildir.pp index 8444a9e..d871654 100644 --- a/manifests/maildir.pp +++ b/manifests/maildir.pp @@ -22,7 +22,7 @@ define backupninja::maildir( $remove = false, $multiconnection = yes, $keepdaily='4', $keepweekly='2', $keepmonthly='2') { - include backupninja::client + include backupninja::client::defaults case $srcdir { false: { err("need to define a source directory to backup!") } } case $destdir { false: { err("need to define a destination directory to backup!") } } @@ -30,12 +30,12 @@ define backupninja::maildir( case $destuser { false: { err("need to define a destination user for backups!") } } case $destid_file { false: { err("need to define a ssh key id file to use!") } } - file { "${backupninja::client::configdir}/${order}_${name}.maildir": + file { "${backupninja::client::defaults::configdir}/${order}_${name}.maildir": ensure => $ensure, content => template('backupninja/maildir.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } } diff --git a/manifests/mysql.pp b/manifests/mysql.pp index e7c0eb4..e6cfe90 100644 --- a/manifests/mysql.pp +++ b/manifests/mysql.pp @@ -20,13 +20,13 @@ define backupninja::mysql( $sqldump = false, $compress = false, $configfile = '/etc/mysql/debian.cnf', $vsname = false) { - include backupninja::client - file { "${backupninja::client::configdir}/${order}_${name}.mysql": + include backupninja::client::defaults + file { "${backupninja::client::defaults::configdir}/${order}_${name}.mysql": ensure => $ensure, content => template('backupninja/mysql.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } } diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index 904c68f..9f81d8f 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -27,7 +27,7 @@ define backupninja::rdiff( $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true, $backuptag = false, $home = false, $backupkeytype = "rsa") { - include backupninja::client + include backupninja::client::defaults case $directory { false: { err("need to define a directory for where the backups should go!") } } @@ -55,13 +55,13 @@ define backupninja::rdiff( } } } - file { "${backupninja::client::configdir}/${order}_${name}.rdiff": + file { "${backupninja::client::defaults::configdir}/${order}_${name}.rdiff": ensure => $ensure, content => template('backupninja/rdiff.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } } diff --git a/manifests/sh.pp b/manifests/sh.pp index a49a3d1..fa6aca5 100644 --- a/manifests/sh.pp +++ b/manifests/sh.pp @@ -14,13 +14,13 @@ define backupninja::sh($order = 50, $ensure = present, $command_string ) { - include backupninja::client - file { "${backupninja::client::configdir}/${order}_${name}.sh": + include backupninja::client::defaults + file { "${backupninja::client::defaults::configdir}/${order}_${name}.sh": ensure => $ensure, content => template('backupninja/sh.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } } diff --git a/manifests/svn.pp b/manifests/svn.pp index 903be74..3ab59c9 100644 --- a/manifests/svn.pp +++ b/manifests/svn.pp @@ -17,13 +17,13 @@ define backupninja::svn($order = 20, $tmp = '/var/backups/svn.tmp', $vsname = false ) { - include backupninja::client - file { "${backupninja::client::configdir}/${order}_${name}.svn": + include backupninja::client::defaults + file { "${backupninja::client::defaults::configdir}/${order}_${name}.svn": ensure => $ensure, content => template('backupninja/svn.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } } diff --git a/manifests/sys.pp b/manifests/sys.pp index 106da9b..973f880 100644 --- a/manifests/sys.pp +++ b/manifests/sys.pp @@ -22,13 +22,13 @@ define backupninja::sys($order = 30, $hardwarefile = '/var/backups/hardware.txt', $dohwinfo = yes ) { - include backupninja::client - file { "${backupninja::client::configdir}/${order}_${name}.sys": + include backupninja::client::defaults + file { "${backupninja::client::defaults::configdir}/${order}_${name}.sys": ensure => $ensure, content => template('backupninja/sys.conf.erb'), owner => root, group => root, mode => 0600, - require => File["${backupninja::client::configdir}"] + require => File["${backupninja::client::defaults::configdir}"] } } -- cgit v1.2.3 From 5fe3a1b401fbac378a8ed802518da5fb2420f17e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 28 Aug 2009 17:54:25 -0300 Subject: Trying a different way to test definitions at backupninja::client::key --- manifests/client.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index f8c5e23..869e75b 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -75,15 +75,18 @@ class backupninja::client inherits backupninja::client::defaults { default => $keytype, } + $key_dest = "${backupninja::client::defaults::real_keydestination}" + $key_dest_file = "$key_dest/id_$key_type" + case $install_key { true: { - if !defined(File["${backupninja::client::defaults::real_keydestination}"]) { + if !defined(File["$key_dest"]) { file { "${backupninja::client::defaults::real_keydestination}": ensure => directory, mode => 0700, owner => $key_owner, group => $key_group, } } - if !defined(File["${backupninja::client::defaults::real_keydestination/id_${key_type}"]) { + if !defined(File["$key_dest_file"]) { file { "${backupninja::client::defaults::real_keydestination}/id_${key_type}": source => "${key_store}/${real_user}_id_${key_type}", mode => 0400, owner => $key_owner, group => $key_group, -- cgit v1.2.3 From cf23487312c5c478b10f3443e31d7edc64b15448 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 28 Aug 2009 17:59:17 -0300 Subject: Trying a different way to test definitions at backupninja::client::key (2) --- manifests/client.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 869e75b..134a7e1 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -81,13 +81,13 @@ class backupninja::client inherits backupninja::client::defaults { case $install_key { true: { if !defined(File["$key_dest"]) { - file { "${backupninja::client::defaults::real_keydestination}": + file { "$key_dest": ensure => directory, mode => 0700, owner => $key_owner, group => $key_group, } } if !defined(File["$key_dest_file"]) { - file { "${backupninja::client::defaults::real_keydestination}/id_${key_type}": + file { "$key_dest_file": source => "${key_store}/${real_user}_id_${key_type}", mode => 0400, owner => $key_owner, group => $key_group, require => File["${backupninja::client::defaults::real_keydestination}"], -- cgit v1.2.3 From 7e26b6e6ef286313cc79563a5da6333433da4204 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 28 Aug 2009 18:19:35 -0300 Subject: Trying a different way to test definitions at backupninja::client::key (3) --- manifests/client.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/client.pp b/manifests/client.pp index 134a7e1..c21e669 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -90,7 +90,7 @@ class backupninja::client inherits backupninja::client::defaults { file { "$key_dest_file": source => "${key_store}/${real_user}_id_${key_type}", mode => 0400, owner => $key_owner, group => $key_group, - require => File["${backupninja::client::defaults::real_keydestination}"], + require => File["$key_dest"], } } } -- cgit v1.2.3 From c823b2865bfc5ce19e91afda2572e1f66d5613e3 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 28 Aug 2009 18:27:47 -0300 Subject: Adding keytype at backupninja::client::key --- manifests/rdiff.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index 9f81d8f..f810357 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -51,7 +51,8 @@ define backupninja::rdiff( backupninja::client::key { "${user}-${name}": user => $user, host => $host, - installkey => $installkey + installkey => $installkey, + keytype => $backupkeytype, } } } -- cgit v1.2.3 From 70cae2f75b1938ac26a75597a8e75dc3e7d327b7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 29 Aug 2009 13:18:54 -0300 Subject: Adding missing keystore and backupkeystore parameters at rdiff and dup definitions --- manifests/dup.pp | 1 + manifests/rdiff.pp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/manifests/dup.pp b/manifests/dup.pp index 6e0330a..dc597f7 100644 --- a/manifests/dup.pp +++ b/manifests/dup.pp @@ -116,6 +116,7 @@ define backupninja::duplicity( $order = 90, host => $desthost, installkey => $installkey, keytype => $backupkeytype, + keystore => $backupkeystore, } # the backupninja rule for this duplicity backup diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp index f810357..b32a262 100644 --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@ -25,7 +25,7 @@ define backupninja::rdiff( "/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ], $vsinclude = false, $keep = 30, $sshoptions = false, $options = false, $ssh_dir_manage = true, $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true, - $backuptag = false, $home = false, $backupkeytype = "rsa") + $backuptag = false, $home = false, $backupkeytype = "rsa", $backupkeystore = false) { include backupninja::client::defaults @@ -45,7 +45,7 @@ define backupninja::rdiff( "${user}-${name}": user => $user, host => $host, dir => $real_home, manage_ssh_dir => $ssh_dir_manage, ssh_dir => $ssh_dir, authorized_keys_file => $authorized_keys_file, installuser => $installuser, - backuptag => $backuptag, keytype => $backupkeytype, + backuptag => $backuptag, keytype => $backupkeytype, backupkeys => $backupkeystore, } backupninja::client::key @@ -53,6 +53,7 @@ define backupninja::rdiff( "${user}-${name}": user => $user, host => $host, installkey => $installkey, keytype => $backupkeytype, + keystore => $backupkeystore, } } } -- cgit v1.2.3