diff --git a/manifests/init.pp b/manifests/init.pp index 8f1f5fd..46bb154 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -18,15 +18,18 @@ class rsnapshot ( $exclude = $rsnapshot::params::config_exclude, $snapshot_root = $rsnapshot::params::config_snapshot_root, $backup_levels = $rsnapshot::params::config_backup_levels, + $cron_service_name = $rsnapshot::params::cron_service_name, ) inherits rsnapshot::params { $default_backup_scripts = $rsnapshot::params::backup_scripts + $backup_scripts $default_exclude = $rsnapshot::params::config_exclude + $exclude if $hosts { class { '::rsnapshot::install': }-> - class { '::rsnapshot::config': } + class { '::rsnapshot::config': }~> + class { '::rsnapshot::service': } contain '::rsnapshot::install' contain '::rsnapshot::config' + contain '::rsnapshot::service' } } diff --git a/manifests/params.pp b/manifests/params.pp index 2e64ebd..6a26d1a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -7,6 +7,7 @@ class rsnapshot::params { $config_backup_user = 'root' $package_name = 'rsnapshot' $package_ensure = 'present' + $cron_service_name = 'crond' $cron_dir = '/etc/cron.d' $config_backup_levels = [ 'daily', 'weekly', 'monthly' ] $config_backup_defaults = true diff --git a/manifests/service.pp b/manifests/service.pp new file mode 100644 index 0000000..9769161 --- /dev/null +++ b/manifests/service.pp @@ -0,0 +1,10 @@ +# == Class: rsnapshot::service +# +# Reloads cron +class rsnapshot::service { + service { $rsnapshot::cron_service_name: + ensure => running, + } + +} +