aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README34
-rw-r--r--manifests/client.pp11
-rw-r--r--manifests/dup.pp28
-rw-r--r--manifests/rdiff.pp3
4 files changed, 54 insertions, 22 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 8368eb4..c3d186d 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -109,3 +109,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,
+ }
+ }
+}
+
diff --git a/manifests/dup.pp b/manifests/dup.pp
index f12fc0f..5e58c2b 100644
--- a/manifests/dup.pp
+++ b/manifests/dup.pp
@@ -30,21 +30,25 @@
#
# 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.
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 = 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 +71,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
@@ -84,13 +88,13 @@ 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!") } }
+ 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}":
diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp
index 579071b..98a74b2 100644
--- a/manifests/rdiff.pp
+++ b/manifests/rdiff.pp
@@ -28,6 +28,9 @@ define backupninja::rdiff(
$backuptag = false, $home = false, $backupkeytype = '')
{
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!") } }