mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2024-11-13 01:00:34 +00:00
ensure in-/exclude file is absent if no in-/excludes given
This commit is contained in:
parent
941036d986
commit
ab9ec44ced
@ -67,8 +67,8 @@ class rsnapshot::config (
|
|||||||
$one_fs = pick_undef($hash['one_fs'], $rsnapshot::params::config_one_fs)
|
$one_fs = pick_undef($hash['one_fs'], $rsnapshot::params::config_one_fs)
|
||||||
$interval = pick($hash['interval'], $rsnapshot::params::config_interval)
|
$interval = pick($hash['interval'], $rsnapshot::params::config_interval)
|
||||||
$retain = pick_undef($hash['retain'], $rsnapshot::params::config_retain)
|
$retain = pick_undef($hash['retain'], $rsnapshot::params::config_retain)
|
||||||
$include = $hash['include']
|
$include = pick($hash['include'], [])
|
||||||
$exclude = $hash['exclude']
|
$exclude = pick($hash['exclude'], [])
|
||||||
$include_file = pick($hash['include_file'], $rsnapshot::params::config_include_file, "${conf_d}/${host}.include")
|
$include_file = pick($hash['include_file'], $rsnapshot::params::config_include_file, "${conf_d}/${host}.include")
|
||||||
$exclude_file = pick($hash['exclude_file'], $rsnapshot::params::config_exclude_file, "${conf_d}/${host}.exclude")
|
$exclude_file = pick($hash['exclude_file'], $rsnapshot::params::config_exclude_file, "${conf_d}/${host}.exclude")
|
||||||
$link_dest = pick_undef($hash['link_dest'], $rsnapshot::params::config_link_dest)
|
$link_dest = pick_undef($hash['link_dest'], $rsnapshot::params::config_link_dest)
|
||||||
@ -110,7 +110,7 @@ class rsnapshot::config (
|
|||||||
}
|
}
|
||||||
|
|
||||||
$real_include = $rsnapshot::include + $include
|
$real_include = $rsnapshot::include + $include
|
||||||
if $real_include != '' {
|
unless empty($real_include) {
|
||||||
file { $include_file:
|
file { $include_file:
|
||||||
ensure => 'file',
|
ensure => 'file',
|
||||||
content => template('rsnapshot/include.erb'),
|
content => template('rsnapshot/include.erb'),
|
||||||
@ -118,7 +118,7 @@ class rsnapshot::config (
|
|||||||
}
|
}
|
||||||
|
|
||||||
$real_exclude = $rsnapshot::exclude + $exclude
|
$real_exclude = $rsnapshot::exclude + $exclude
|
||||||
if $real_exclude != '' {
|
unless empty($real_exclude) {
|
||||||
file { $exclude_file:
|
file { $exclude_file:
|
||||||
ensure => 'file',
|
ensure => 'file',
|
||||||
content => template('rsnapshot/exclude.erb'),
|
content => template('rsnapshot/exclude.erb'),
|
||||||
|
Loading…
Reference in New Issue
Block a user