1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2024-11-10 00:00:35 +00:00

add backup_defaults feature

This commit is contained in:
Norbert Varzariu 2015-12-19 18:32:24 +01:00
parent 234c5935a6
commit f7922a2e4a
3 changed files with 13 additions and 5 deletions

View File

@ -15,11 +15,19 @@ class rsnapshot::config (
file { $lockpath:
ensure => 'directory',
}
notify {"Hosts is: $hosts ": }
$hosts.each |String $host, Hash $hash | {
$snapshot_root = pick($hash['snapshot_root'], $rsnapshot::params::config_snapshot_root)
$backups = pick($hash['backups'], $rsnapshot::params::config_backups)
$backup = pick($hash['backup'], $rsnapshot::params::config_backup)
$backup_user = pick($hash['backup_user'], $rsnapshot::params::config_backup_user)
$backup_defaults = pick($hash['backup_defaults'], $rsnapshot::params::config_backup_defaults)
if $backup_defaults {
$backups = merge($backup, $rsnapshot::params::config_backup)
} else {
$backups = $backup
}
$cmd_cp = pick($hash['cmd_cp'], $rsnapshot::params::config_cmd_cp)
$cmd_rm = pick($hash['cmd_rm'], $rsnapshot::params::config_cmd_rm)
$cmd_rsync = pick($hash['cmd_rsync'], $rsnapshot::params::config_cmd_rsync)

View File

@ -7,6 +7,7 @@ class rsnapshot::params {
$config_backup_user = 'root'
$package_name = 'rsnapshot'
$package_ensure = 'present'
$config_backup_defaults = true
$config_version = '1.2'
$config_cmd_cp = '/bin/cp'
$config_cmd_rm = '/bin/rm'
@ -53,7 +54,7 @@ class rsnapshot::params {
$config_sync_first = false
$config_rsync_numtries = 1
$config_use_lazy_deletes = false
$config_backups = {
$config_backup = {
'/etc' => './',
'/home' => './',
}

View File

@ -16,7 +16,6 @@
{ "name": "puppet", "version_requirement": ">= 3.0.0" }
],
"dependencies": [
{ "name": "puppetlabs-stdlib","version_range": ">= 1.0.0"
}
{ "name": "puppetlabs-stdlib","version_range": ">= 1.0.0" }
]
}