From 6406454bbf71595c511d8ccf838a6007b4fe1e5e Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sat, 17 May 2008 23:31:38 +0000 Subject: create a backupninja svn piece to the module --- manifests/svn.pp | 32 ++++++++++++++++++++++++++++++++ templates/svn.conf.erb | 10 ++++++++++ 2 files changed, 42 insertions(+) create mode 100644 manifests/svn.pp create mode 100644 templates/svn.conf.erb diff --git a/manifests/svn.pp b/manifests/svn.pp new file mode 100644 index 0000000..db46ad9 --- /dev/null +++ b/manifests/svn.pp @@ -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 index 0000000..465cc67 --- /dev/null +++ b/templates/svn.conf.erb @@ -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 -- cgit v1.2.3