]> gitweb.fluxo.info Git - puppet-backupninja.git/commitdiff
create a backupninja svn piece to the module
authorMicah Anderson <micah@riseup.net>
Sat, 17 May 2008 23:31:38 +0000 (23:31 +0000)
committerMicah Anderson <micah@riseup.net>
Sat, 17 May 2008 23:31:38 +0000 (23:31 +0000)
manifests/svn.pp [new file with mode: 0644]
templates/svn.conf.erb [new file with mode: 0644]

diff --git a/manifests/svn.pp b/manifests/svn.pp
new file mode 100644 (file)
index 0000000..db46ad9
--- /dev/null
@@ -0,0 +1,32 @@
+# Subversion dumps, 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).
+#
+#   user, dbusername, dbpassword, dbhost, databases, backupdir,
+#   hotcopy, sqldump, compress, configfile: As defined in the
+#   backupninja documentation, with the caveat that hotcopy, sqldump,
+#   and compress take true/false rather than yes/no.
+# 
+define backupninja::svn($order = 20,
+                           $ensure = present,
+                           $src = '/var/lib/svn',
+                           $dest = '/var/backups/svn',
+                           $tmp = '/var/backups/svn.tmp',
+                           $vsname = false,
+                          ) {
+       file { "${backupninja::client::configdir}/${order}_${name}.svn":
+               ensure => $ensure,
+               content => template('backupninja/svn.conf.erb'),
+               owner => root,
+               group => root,
+               mode => 0600,
+               require => File["${backupninja::client::configdir}"]
+       }
+}
diff --git a/templates/svn.conf.erb b/templates/svn.conf.erb
new file mode 100644 (file)
index 0000000..465cc67
--- /dev/null
@@ -0,0 +1,10 @@
+# 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{src dest tmp vsname}.each do |v|
+       if send(v)
+               -%><%= v + ' = ' + send(v) + "\n" %><%
+       end
+end -%>
\ No newline at end of file