mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2024-12-16 09:40:35 +00:00
add backup_defaults feature
This commit is contained in:
parent
234c5935a6
commit
f7922a2e4a
@ -16,10 +16,18 @@ class rsnapshot::config (
|
||||
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)
|
||||
|
@ -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' => './',
|
||||
}
|
||||
|
@ -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" }
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user