1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2024-11-14 01:00:34 +00:00

restart cron service after config change

This commit is contained in:
Norbert Varzariu 2016-01-22 09:31:51 +01:00
parent 7318f9b2dc
commit d71239645f
3 changed files with 16 additions and 2 deletions

View File

@ -18,15 +18,18 @@ class rsnapshot (
$exclude = $rsnapshot::params::config_exclude, $exclude = $rsnapshot::params::config_exclude,
$snapshot_root = $rsnapshot::params::config_snapshot_root, $snapshot_root = $rsnapshot::params::config_snapshot_root,
$backup_levels = $rsnapshot::params::config_backup_levels, $backup_levels = $rsnapshot::params::config_backup_levels,
$cron_service_name = $rsnapshot::params::cron_service_name,
) inherits rsnapshot::params { ) inherits rsnapshot::params {
$default_backup_scripts = $rsnapshot::params::backup_scripts + $backup_scripts $default_backup_scripts = $rsnapshot::params::backup_scripts + $backup_scripts
$default_exclude = $rsnapshot::params::config_exclude + $exclude $default_exclude = $rsnapshot::params::config_exclude + $exclude
if $hosts { if $hosts {
class { '::rsnapshot::install': }-> class { '::rsnapshot::install': }->
class { '::rsnapshot::config': } class { '::rsnapshot::config': }~>
class { '::rsnapshot::service': }
contain '::rsnapshot::install' contain '::rsnapshot::install'
contain '::rsnapshot::config' contain '::rsnapshot::config'
contain '::rsnapshot::service'
} }
} }

View File

@ -7,6 +7,7 @@ class rsnapshot::params {
$config_backup_user = 'root' $config_backup_user = 'root'
$package_name = 'rsnapshot' $package_name = 'rsnapshot'
$package_ensure = 'present' $package_ensure = 'present'
$cron_service_name = 'crond'
$cron_dir = '/etc/cron.d' $cron_dir = '/etc/cron.d'
$config_backup_levels = [ 'daily', 'weekly', 'monthly' ] $config_backup_levels = [ 'daily', 'weekly', 'monthly' ]
$config_backup_defaults = true $config_backup_defaults = true
@ -32,7 +33,7 @@ class rsnapshot::params {
$config_logpath = '/var/log/rsnapshot' $config_logpath = '/var/log/rsnapshot'
$config_logfile = '/var/log/rsnapshot.log' # unused, we are logging to $logpath/$host.log $config_logfile = '/var/log/rsnapshot.log' # unused, we are logging to $logpath/$host.log
$config_lockpath = '/var/run/rsnapshot' $config_lockpath = '/var/run/rsnapshot'
$config_snapshot_root = '/backup/' $config_snapshot_root = '/backup'
$config_no_create_root = undef # bool, true or false $config_no_create_root = undef # bool, true or false
$config_verbose = '2' $config_verbose = '2'
$config_loglevel = '4' $config_loglevel = '4'

10
manifests/service.pp Normal file
View File

@ -0,0 +1,10 @@
# == Class: rsnapshot::service
#
# Reloads cron
class rsnapshot::service {
service { $rsnapshot::cron_service_name:
ensure => running,
}
}