From 640e86a156a8c4d9e6ba9a4918e81946ad282fe2 Mon Sep 17 00:00:00 2001 From: Norbert Varzariu Date: Mon, 21 Dec 2015 11:43:50 +0100 Subject: [PATCH] add epel as dependecy for CentOS --- manifests/config.pp | 11 ----------- manifests/init.pp | 9 ++++----- manifests/install.pp | 5 ++++- manifests/params.pp | 8 -------- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index ea3ecf8..5790694 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -16,7 +16,6 @@ class rsnapshot::config ( 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: @@ -109,19 +108,9 @@ class rsnapshot::config ( content => template('rsnapshot/rsnapshot.erb') } - - ########################### CRON #################################################### - #30 1 * * * /usr/bin/rsnapshot -c /etc/rsnapshot/cmweb1.rsnapshot.conf daily - #15 1 * * 0 /usr/bin/rsnapshot -c /etc/rsnapshot/cmweb1.rsnapshot.conf weekly - # 00 1 1 * * /usr/bin/rsnapshot -c /etc/rsnapshot/cmweb1.rsnapshot.conf monthly $cronfile = "/tmp/rsnapshot.d/cron/${host}" concat { "${cronfile}": - # replace => false, } - # $cron = pick($hash['cron'], $rsnapshot::params::cron) - - - # notify { "cron is ${cron} ": } $backup_levels.each |String $level| { if validate_hash($hash) { # allow to globally override ranges, create random numbers for backup_levels daily, weekly, monthly diff --git a/manifests/init.pp b/manifests/init.pp index 48dc1c3..0c26dfd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -10,14 +10,13 @@ class rsnapshot ( $logpath = $rsnapshot::params::config_logpath, $lockpath = $rsnapshot::params::config_lockpath, $default_backup = $rsnapshot::params::config_default_backup, + $package_name = $rsnapshot::params::package_name, + $package_ensure = $rsnapshot::params::package_ensure, ) inherits rsnapshot::params { - - # anchor { 'rsnapshot::begin': } -> - #class { 'rsnapshot::install': } -> - #class { 'rsnapshot::config': } -> - #anchor { 'rsnapshot::end': } if $hosts { + class { 'rsnapshot::install': }-> class { 'rsnapshot::config': } + contain 'rsnapshot::install' contain 'rsnapshot::config' } } diff --git a/manifests/install.pp b/manifests/install.pp index 3b71321..0758784 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -2,7 +2,10 @@ # # Installs the rsnapshot package. class rsnapshot::install inherits rsnapshot { - + case $::operatingsystem { + /^CentOS$/: { include epel } + default: {} + } package { $rsnapshot::package_name: ensure => $rsnapshot::package_ensure, } diff --git a/manifests/params.pp b/manifests/params.pp index fb80ba7..c7b070c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -60,14 +60,6 @@ class rsnapshot::params { '/home' => './', } $config_backup_scripts = {} - - # $cron = { - # 'minute' => '0..59', - # 'hour' => '0..23', # you could also do: ['21..23','0..4','5'], - # 'monthday' => '0..28', - # 'month' => '1..12', - # 'weekday' => '0..6', - # } $cron = { 'hourly' => { 'minute' => '0..59',