From: Jerome Charaoui Date: Thu, 7 May 2015 17:59:28 +0000 (-0400) Subject: Merge branch 'multi-backup' X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=e465032ecc82979ae8e4dce074970cb03273fe7d;p=puppet-backupninja.git Merge branch 'multi-backup' Conflicts: README See merge request !5 --- e465032ecc82979ae8e4dce074970cb03273fe7d diff --cc README index f459061,94ad952..e8cef4d --- a/README +++ b/README @@@ -8,33 -8,38 +8,56 @@@ backupninja 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 could stop working. -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. ++your backups could stop working or get duplicated. + +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. ++now read several default values from the backupninja base class. If you ++were using the rdiff-backup handler, read the following section ++carefully. Other handlers have not changed in any significant way. + - See below for dependencies which have been introduced in this version. ++Changes to the rdiff-backup handler ++----------------------------------- + - Dependencies ++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. + + The rdiff resource name is now used as the subdirectory where rdiff + backups are sent. This was previously hardcoded to "rdiff-backup", but + in order to support multiple rdiff backups per host, we now use the + resource name. So if you were using the following resource: + + backupninja::rdiff { 'main': } + + You will want to use the following resource: + + backupninja::rdiff { 'rdiff-backup': } + file { '/etc/backup.d/90_main.rdiff': ensure => absent; } + + Otherwise your backups may be duplicated! + + Getting started --------------- -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 ---------------------------- diff --cc manifests/rdiff.pp index 6a602ea,999eb5d..74afa8c --- a/manifests/rdiff.pp +++ b/manifests/rdiff.pp @@@ -26,13 -26,11 +26,13 @@@ define backupninja::rdiff "/home", "/usr/local/*bin", "/var/lib/dpkg/status*" ], $vsinclude = false, $keep = 30, $sshoptions = false, $options = '--force', $ssh_dir_manage = true, $ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true, $key = false, - $backuptag = false, $backupkeytype = "rsa", $backupkeystore = false, $extras = false, $nagios2_description = 'backups') + $backuptag = false, $backupkeytype = $backupninja::keytype, $backupkeystore = $backupninja::keystore, + $extras = false, $nagios_description = 'backups') { - include backupninja::client::rdiff_backup + # install client dependencies + ensure_resource('package', 'rdiff-backup', {'ensure' => $backupninja::ensure_rdiffbackup_version}) - $directory = "$home/rdiff-backup/" + $directory = "$home/$name/" case $type { 'remote': {