aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2008-07-08 18:43:40 +0000
committerMicah Anderson <micah@riseup.net>2008-07-08 18:43:40 +0000
commit05b987d4d81e8d46203a9dc368eab25c8b973dfc (patch)
tree1112340b50216797e2636926635c5d9531baafd0
parent3ae2a2ab4cc133b7146ff345804e2d3935d4622a (diff)
downloadpuppet-backupninja-05b987d4d81e8d46203a9dc368eab25c8b973dfc.tar.gz
puppet-backupninja-05b987d4d81e8d46203a9dc368eab25c8b973dfc.tar.bz2
make new maildir piece to backupninja module
-rw-r--r--manifests/maildir.pp38
-rw-r--r--templates/maildir.conf.erb14
2 files changed, 52 insertions, 0 deletions
diff --git a/manifests/maildir.pp b/manifests/maildir.pp
new file mode 100644
index 0000000..b7f36f7
--- /dev/null
+++ b/manifests/maildir.pp
@@ -0,0 +1,38 @@
+# maildir handler, as part of a backupninja run.
+#
+# The maildir handler slowly creates a backup of each user's
+# maildir to a remote server. It is designed to be run with
+# low overhead in terms of CPU and bandwidth, so it runs pretty
+# slow. Hardlinking is used to save storage space. The actual
+# maildir is stored within each snapshot directory.
+#
+# 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).
+#
+#
+define backupninja::maildir($order = 40,
+ $ensure = present,
+ $srcdir = '/maildir',
+ $destdir = '/crypt/maildir',
+ $desthost = false,
+ $destuser = false,
+ $destid_file = '/root/.ssh/id_rsa',
+ $remove = no,
+ $multiconnection = yes
+ ) {
+ include backupninja::client
+ file { "${backupninja::client::configdir}/${order}_${name}.maildir":
+ ensure => $ensure,
+ content => template('backupninja/maildir.conf.erb'),
+ owner => root,
+ group => root,
+ mode => 0600,
+ require => File["${backupninja::client::configdir}"]
+ }
+}
diff --git a/templates/maildir.conf.erb b/templates/maildir.conf.erb
new file mode 100644
index 0000000..370596a
--- /dev/null
+++ b/templates/maildir.conf.erb
@@ -0,0 +1,14 @@
+# 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.
+
+<% %w{srcdir destdir desthost destuser destid_file}.each do |v|
+ if send(v)
+ -%><%= v + ' = ' + send(v) + "\n" %><%
+ end
+end -%>
+
+remove = <%= remove ? 'yes' : 'no' %>
+multiconnection = <%= multiconnection ? 'yes' : 'no' %>
+