]> gitweb.fluxo.info Git - puppet-backupninja.git/commitdiff
sh backupninja handler.
authorPietro <pietro@riseup.net>
Tue, 8 Jul 2008 18:43:42 +0000 (18:43 +0000)
committerPietro <pietro@riseup.net>
Tue, 8 Jul 2008 18:43:42 +0000 (18:43 +0000)
manifests/sh.pp [new file with mode: 0644]
templates/sh.conf.erb [new file with mode: 0644]

diff --git a/manifests/sh.pp b/manifests/sh.pp
new file mode 100644 (file)
index 0000000..77d7fb8
--- /dev/null
@@ -0,0 +1,26 @@
+# sh handler, 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).
+#
+# 
+define backupninja::sh($order = 30,
+                           $ensure = present,
+                           $command_string
+                          ) {
+                          include backupninja::client
+       file { "${backupninja::client::configdir}/${order}_${name}.sh":
+               ensure => $ensure,
+               content => template('backupninja/sh.conf.erb'),
+               owner => root,
+               group => root,
+               mode => 0600,
+               require => File["${backupninja::client::configdir}"]
+       }
+}
diff --git a/templates/sh.conf.erb b/templates/sh.conf.erb
new file mode 100644 (file)
index 0000000..f1e77ff
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# 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.
+
+<% command_string.each do |line| -%>
+<%= line %>
+<% end -%>