]> gitweb.fluxo.info Git - puppet-backupninja.git/commitdiff
I dont like how any of this is done, but it needs to be working again,
authorMicah Anderson <micah@riseup.net>
Wed, 21 May 2008 16:56:41 +0000 (16:56 +0000)
committerMicah Anderson <micah@riseup.net>
Wed, 21 May 2008 16:56:41 +0000 (16:56 +0000)
and then made better later.

The ninjareport is a pretty bad way of collecting all the backupninja
reports into one email called the 'ninjareport' which contains all the
hosts with backupninja problems, and a notice about any hosts that
haven't reported in for a while.

The way it works is each participating host has a limited command ssh
key installed in /root/.ssh/id_rsa which enables it to rsync its
/var/log/backupninja.log to
ninja@admin:/var/lib/backupninja/reports/$hostname.log. After the
backup runs on the host, it does this rsync.

On v.admin, there is a /var/lib/backupninja/.ssh/authorized_keys which
has the ssh public key part of each host's ssh key, command-limited to
only allow an rsync of their backupninja.log file. There is a cronjob
there that runs once a day and collects new logs and does some basic
figuring and then collects those all into one email.

There are *many* ways that this needs to be improved. From the puppet
side, the approach is all wrong, and there is a lot of dupliacted
configuration that is being done, it needs to be turned into a define
and export and collection needs to be done. The whole thing needs to
be redesigned from the ground up, but I don't have the mental space to
do it right now, and it needs to work :(

manifests/config.pp
templates/backupninja.conf.erb

index 87103dbd7fb4b5cc07cca4e5c235068f107d5e86..e82ec4d75040ff0e2ac19e235eeb9d4af4ba27e5 100644 (file)
@@ -8,6 +8,9 @@ define backupninja::config($configfile = '/etc/backupninja.conf',
                             $reportemail = 'root',
                             $reportsuccess = false,
                             $reportwarning = true,
+                            $reporthost = $reporthost,
+                            $reportuser = $reportuser,
+                            $reportdirectory = $reportdirectory,
                             $logfile = '/var/log/backupninja.log',
                             $configdir = '/etc/backup.d',
                             $scriptdir = '/usr/share/backupninja',
index fb2a8bedf68c3633cd37814978075f46ace67a23..7502a4c7b1bf5f2319ca7a7e9697a2a3c25095a2 100644 (file)
@@ -8,6 +8,9 @@ when = <%= send(:when) %>
 reportemail = <%= reportemail %>
 reportsuccess = <%= reportsuccess ? 'yes' : 'no' %>
 reportwarning = <%= reportwarning ? 'yes' : 'no' %>
+reporthost = <%= reporthost %>
+reportuser = <%= reportuser %>
+reportdirectory = <%= reportdirectory %>
 logfile = <%= logfile %>
 configdirectory = <%= configdir %>
 scriptdirectory = <%= scriptdir %>