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 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 manifests/dup.pp (limited to '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}"] + } +} + -- 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(-) (limited to 'manifests/dup.pp') 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 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(+) (limited to 'manifests/dup.pp') 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 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(+) (limited to 'manifests/dup.pp') 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(-) (limited to 'manifests/dup.pp') 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(+) (limited to 'manifests/dup.pp') 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 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(-) (limited to 'manifests/dup.pp') 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 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(+) (limited to 'manifests/dup.pp') 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 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(-) (limited to 'manifests/dup.pp') 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(-) (limited to 'manifests/dup.pp') 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(-) (limited to 'manifests/dup.pp') 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 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(+) (limited to 'manifests/dup.pp') 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(+) (limited to 'manifests/dup.pp') 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 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(-) (limited to 'manifests/dup.pp') 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 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(-) (limited to 'manifests/dup.pp') 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(-) (limited to 'manifests/dup.pp') 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 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(-) (limited to 'manifests/dup.pp') 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