1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2025-09-13 15:59:28 +00:00

fix README.md

This commit is contained in:
Norbert Varzariu
2015-12-21 14:50:17 +01:00
parent 25ae6a3af7
commit 3e7834c2ac
3 changed files with 30 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ class rsnapshot::config (
$config_version = $rsnapshot::params::config_version
$lockpath = pick($rsnapshot::lockpath, $rsnapshot::params::config_lockpath)
$conf_d = pick($rsnapshot::conf_d, $rsnapshot::params::conf_d)
$snapshot_root = pick($hosts['snapshot_root'], $rsnapshot::params::config_snapshot_root)
# make sure lock path and conf path exist
file { $conf_d:
ensure => 'directory',
@@ -19,6 +20,9 @@ class rsnapshot::config (
file { $cron_dir:
ensure => 'directory',
}
file { $snapshot_root:
ensure => 'directory',
}
# custom function, if only a hostname is given as a param, this is an empty hash
# the next loop would break as puppet does not allow to reassign variables
# the function checks $hosts for elements like:
@@ -26,7 +30,6 @@ class rsnapshot::config (
$hosts_clean = assert_empty_hash($hosts)
$hosts_clean.each |String $host, Hash $hash | {
$snapshot_root = pick($hash['snapshot_root'], $rsnapshot::params::config_snapshot_root)
$backup_user = pick($hash['backup_user'], $rsnapshot::params::config_backup_user)
$default_backup_dirs = pick($rsnapshot::default_backup, $rsnapshot::params::config_default_backup)
$backup_levels = pick($hash['backup_levels'], $rsnapshot::params::config_backup_levels, 'weekly')
@@ -105,13 +108,12 @@ class rsnapshot::config (
}
file { $exclude_file:
ensure => file,
ensure => 'file',
}
file { $config:
content => template('rsnapshot/rsnapshot.erb')
}
$cronfile = "/tmp/rsnapshot.d/cron/${host}"
$cronfile = "${cron_dir}/${host}"
concat { "${cronfile}":
}
$backup_levels.each |String $level| {

View File

@@ -3,11 +3,11 @@
# default params
class rsnapshot::params {
$hosts = undef
$conf_d = '/tmp/rsnapshot.d' # the place where the host specific configs are stored
$config_backup_user = 'root'
$conf_d = '/etc/rsnapshot' # the place where the host specific configs are stored
$config_backup_user = 'root'
$package_name = 'rsnapshot'
$package_ensure = 'present'
$cron_dir = '/tmp/rsnapshot.d/cron'
$cron_dir = '/etc/cron.d'
$config_backup_levels = [ 'daily', 'weekly', ]
$config_backup_defaults = true
$config_version = '1.2'