1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2024-12-16 09:40:35 +00:00

Merge pull request #10 from runejuhl/unmanage_cron

- Add option to unmanage cron
- Fix undefined vars (for running puppet in strict mode)
This commit is contained in:
Norbert Varzariu 2017-04-09 09:41:55 +02:00 committed by GitHub
commit 92a466d90a
4 changed files with 15 additions and 9 deletions

View File

@ -12,8 +12,8 @@ class rsnapshot::config (
$conf_d = pick($rsnapshot::conf_d, $rsnapshot::params::conf_d, '/etc/rsnapshot')
$snapshot_root = pick($hosts['snapshot_root'], $rsnapshot::snapshot_root, '/backup')
$logpath = pick($rsnapshot::logpath, $rsnapshot::params::config_logpath)
$cronfile_prefix_use = pick($rsnapshot::cronfile_prefix_use, $rsnapshot::params::cronfile_prefix_use, false)
$cronfile_prefix = pick($rsnapshot::cronfile_prefix, $rsnapshot::params::cronfile_prefix, '')
$cronfile_prefix_use = pick($rsnapshot::cronfile_prefix_use, $rsnapshot::params::config_cronfile_prefix_use, false)
$cronfile_prefix = pick($rsnapshot::cronfile_prefix, $rsnapshot::params::config_cronfile_prefix, '')
# make sure lock path and conf path exist
file { $conf_d:
ensure => 'directory',
@ -82,7 +82,7 @@ class rsnapshot::config (
$rsync_numtries = pick_undef($hash['rsync_numtries'], $rsnapshot::params::config_rsync_numtries)
#$backup_scripts = pick_undef($hash['backup_scripts'], $rsnapshot::params::config_backup_scripts)
$snapshot_dir = "${config_snapshot_root}/${host}"
$snapshot_dir = "${snapshot_root}/${host}"
$config = "${conf_d}/${host}.rsnapshot.conf"
$lockfile = "${lockpath}/${host}.pid"
$logfile = "${logpath}/${host}.log"

View File

@ -18,7 +18,9 @@ class rsnapshot (
$exclude = $rsnapshot::params::config_exclude,
$snapshot_root = $rsnapshot::params::config_snapshot_root,
$backup_levels = $rsnapshot::params::config_backup_levels,
$backup_user = $rsnapshot::params::config_backup_user,
$cron_service_name = $rsnapshot::params::cron_service_name,
$manage_cron = $rsnapshot::params::manage_cron,
$cronfile_prefix = $rsnapshot::params::config_cronfile_prefix,
$cronfile_prefix_use = $rsnapshot::params::config_cronfile_prefix_use,
$check_mk_job = $rsnapshot::params::config_check_mk_job,

View File

@ -12,6 +12,7 @@ class rsnapshot::params {
'Debian' => 'cron',
default => '',
}
$manage_cron = true
$cron_dir = '/etc/cron.d'
$config_backup_levels = [ 'daily', 'weekly', 'monthly' ]
$config_backup_defaults = true

View File

@ -1,10 +1,13 @@
# == Class: rsnapshot::service
#
# Reloads cron
class rsnapshot::service {
class rsnapshot::service (
$manage_cron = $rsnapshot::manage_cron
) {
if $manage_cron {
service { $rsnapshot::cron_service_name:
ensure => running,
}
}
}