summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorAntoine Beaupré <anarcat+gitlab@anarc.at>2015-04-23 18:33:14 +0000
committerAntoine Beaupré <anarcat+gitlab@anarc.at>2015-04-23 18:33:14 +0000
commitfbddc25ee6e813ceffa88192fb607e63cebf8bba (patch)
treef0be23671b501770c091bafb13ae73d43cdaebda /README
parent74ce68bcf6f1fbf938e4a161f7c6305f67378b7d (diff)
parentb24afc7ffbe844984e7a46a205e7f04d312fd04c (diff)
Merge branch 'march2015-refactor' into 'master'
March2015 refactor This branch is an attempt to bring the backupninja module in the 21st century. See the upgrade notice in the README for details. See merge request !4
Diffstat (limited to 'README')
-rw-r--r--README135
1 files changed, 60 insertions, 75 deletions
diff --git a/README b/README
index a839193..f459061 100644
--- a/README
+++ b/README
@@ -4,28 +4,37 @@ Backupninja Module
This module helps you configure all of your backups with puppet, using
backupninja!
-! Upgrade notice !
+!! UPGRADE NOTICE !!
If you were previously using this module, some pieces have changed,
and you need to carefully change your use of them, or you will find
-your backups to be duplicated on your backup server. The important
-part that changed has to do with the rdiff-backup handler, if you
-weren't using that, you don't need to worry.
-
-If you were, you will need to make sure you change all of your
-"$directory" parameters to be "$home" instead, and on your
-backupserver you will need to move all of your backups into
-"$home"/rdiff-backup. Previously, they were put in "$directory", which
-doubled as the home for the user that was created. This caused
-problems with rdiff-backup because of dot files and other things which
-were not part of any rdiff-backup.
-
-Getting started
+your backups could stop working.
+
+The backupninja::client class has been renamed to backupninja, and is
+now *required* in all node manifests. Make sure the backupninja class
+is now declared in all your node manifests! This new class now defines
+defaults which were previously provided by backupninja::client::defaults,
+and can now be overridden thanks to the brand new technology of class
+parameters. This class also manages the backupninja configuration file,
+replacing the backupninja::config ressource.
+
+The backupninja::server class now takes parameters, replacing several
+global variables such as $backupdir, $backupserver_tag and
+$nagios_server. The $manage_nagios parameter also replaces the
+$use_nagios global.
+
+As for handlers, they don't include the backupninja::client anymore and
+now read several default values from the backupninja base class. Most
+handler declarations shouldn't need any changes.
+
+See below for dependencies which have been introduced in this version.
+
+Dependencies
---------------
-First you will need to import the module:
+This module requires Puppet versions 2.7 and up.
- import "backupninja"
+An up-to-date version of the puppet-stdlib module is also required.
Configure your backup server
----------------------------
@@ -35,41 +44,41 @@ to your node definition for that server:
include backupninja::server
+The default configuration will store backup data in the "/backup"
+directory. To change this you may declare the class with a "backupdir"
+parameter:
+
+ class { 'backupninja::server':
+ backupdir => '/mnt/backupdata'
+ }
+
By configuring a backupninja::server, this module will automatically
create sandboxed users on the server for each client for their
backups.
-You may also want to set some variables on your backup server, such as:
-
- $backupdir = "/backups"
-
-
Configure your backup clients
-----------------------------
-The backupninja package and the necessary backup software will be
-installed automatically when you include any of the different handlers
-(as long as you are not handling it elsewhere in your manifests), for
-example:
+First, you need to include the backupninja class or declare it with
+custom parameters:
-include backupninja::client::rdiff_backup
+ class { 'backupninja':
+ loglvl => 3,
+ usecolors => false,
+ reportsuccess => false,
+ reportwarning => true,
+ ensure_backupninja_version => '1.0.1-1',
+ ensure_rdiffbackup_version => '1.2.8-7'
+ }
In this case, the module will make sure that the backupninja package
-and the required rdiff-backup package are 'installed'/'present' (using
-puppet's ensure parameter language). If you need to specify a specific
-version of either backupninja itself, or the specific programs that
-the handler class installs, you can specify the version you need
-installed by providing a variable, for example:
-
-$backupninja_ensure_version = "0.9.7~bpo50+1"
-$rdiff_backup_ensure_version = "1.2.5-1~bpo40+1"
-$rsync_ensure_version = "3.0.6-1~bpo50+1"
-$duplicity_ensure_version = "0.6.04-1~bpo50+1"
-$debconf_utils_ensure_version = "1.5.28"
-$hwinfo_ensure_version = "16.0-2"
-
-If you do not specify these variables the default 'installed/present'
-version will be installed when you include this class.
+is installed (using puppet's ensure parameter language) and create the
+/etc/backupninja.conf configuration file.
+
+If you need to specify a specific version of either backupninja itself,
+or the specific programs that the handler class installs, you can
+specify the version you need installed by providing a class parameter,
+as shown in the example.
Configuring handlers
--------------------
@@ -87,7 +96,7 @@ Included below are some configuration examples for different handlers.
* An example mysql handler configuration:
-backupninja::mysql { all_databases:
+backupninja::mysql { 'all_databases':
user => root,
backupdir => '/var/backups',
compress => true,
@@ -96,7 +105,7 @@ backupninja::mysql { all_databases:
* An example rdiff-backup handler configuration:
-backupninja::rdiff { backup_all:
+backupninja::rdiff { 'backup_all':
directory => '/media/backupdisk',
include => ['/var/backups', '/home', '/var/lib/dpkg/status'],
exclude => '/home/*/.gnupg'
@@ -104,32 +113,13 @@ backupninja::rdiff { backup_all:
* A remote rdiff-backup handler:
- backupninja::rdiff { "main":
- host => "backup.example.com",
- type => "remote",
- directory => "/backup/$fqdn",
- user => "backup-$hostname",
- }
-
-
-Configuring backupninja itself
-------------------------------
-
-You may wish to configure backupninja itself. You can do that by doing
-the following, and the /etc/backupninja.conf will be managed by
-puppet, all the backupninja configuration options are available, you
-can find them inside this module as well.
-
-For example:
-
-backupninja::config { conf:
- loglvl => 3,
- usecolors => false,
- reportsuccess => false,
- reportwarning => true;
+backupninja::rdiff { 'main':
+ host => 'backup.example.com',
+ type => 'remote',
+ directory => "/backup/${::fqdn}",
+ user => "backup-${::hostname}",
}
-
Automatic creation of ssh-keys for duplicity
--------------------------------------------
@@ -160,9 +150,9 @@ i.e.:
Nagios alerts about backup freshness
------------------------------------
-If you set the $nagios_server variable to be the name of your nagios
-server, then a passive nagios service gets setup so that the backup
-server pushes checks, via a cronjob that calls
+If you set the $backupninja::server::nagios_server variable to be the
+name of your nagios server, then a passive nagios service gets setup so
+that the backup server pushes checks, via a cronjob that calls
/usr/local/bin/checkbackups.pl, to the nagios server to alert about
relative backup freshness.
@@ -171,9 +161,4 @@ To use this feature a few pre-requisites are necessary:
. configure nsca on your backup server (not done via puppet yet)
. configure nsca on your nagios server (not done via puppet yet)
. server backup directories are named after their $fqdn
- . using nagios2 module, nagios/nagios3 modules/nativetypes not supported yet
- . using a nagios puppet module that can create passive service checks
. backups must be under $home/dup, $home/rdiff-backup depending on method
- . $nagios_server must be set before the class is included
-
-