mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2024-11-14 09:00:35 +00:00
add epel as dependecy for CentOS
This commit is contained in:
parent
cafb00e201
commit
640e86a156
@ -16,7 +16,6 @@ class rsnapshot::config (
|
|||||||
ensure => 'directory',
|
ensure => 'directory',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# custom function, if only a hostname is given as a param, this is an empty hash
|
# 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 next loop would break as puppet does not allow to reassign variables
|
||||||
# the function checks $hosts for elements like:
|
# the function checks $hosts for elements like:
|
||||||
@ -109,19 +108,9 @@ class rsnapshot::config (
|
|||||||
content => template('rsnapshot/rsnapshot.erb')
|
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}"
|
$cronfile = "/tmp/rsnapshot.d/cron/${host}"
|
||||||
concat { "${cronfile}":
|
concat { "${cronfile}":
|
||||||
# replace => false,
|
|
||||||
}
|
}
|
||||||
# $cron = pick($hash['cron'], $rsnapshot::params::cron)
|
|
||||||
|
|
||||||
|
|
||||||
# notify { "cron is ${cron} ": }
|
|
||||||
$backup_levels.each |String $level| {
|
$backup_levels.each |String $level| {
|
||||||
if validate_hash($hash) {
|
if validate_hash($hash) {
|
||||||
# allow to globally override ranges, create random numbers for backup_levels daily, weekly, monthly
|
# allow to globally override ranges, create random numbers for backup_levels daily, weekly, monthly
|
||||||
|
@ -10,14 +10,13 @@ class rsnapshot (
|
|||||||
$logpath = $rsnapshot::params::config_logpath,
|
$logpath = $rsnapshot::params::config_logpath,
|
||||||
$lockpath = $rsnapshot::params::config_lockpath,
|
$lockpath = $rsnapshot::params::config_lockpath,
|
||||||
$default_backup = $rsnapshot::params::config_default_backup,
|
$default_backup = $rsnapshot::params::config_default_backup,
|
||||||
|
$package_name = $rsnapshot::params::package_name,
|
||||||
|
$package_ensure = $rsnapshot::params::package_ensure,
|
||||||
) inherits rsnapshot::params {
|
) inherits rsnapshot::params {
|
||||||
|
|
||||||
# anchor { 'rsnapshot::begin': } ->
|
|
||||||
#class { 'rsnapshot::install': } ->
|
|
||||||
#class { 'rsnapshot::config': } ->
|
|
||||||
#anchor { 'rsnapshot::end': }
|
|
||||||
if $hosts {
|
if $hosts {
|
||||||
|
class { 'rsnapshot::install': }->
|
||||||
class { 'rsnapshot::config': }
|
class { 'rsnapshot::config': }
|
||||||
|
contain 'rsnapshot::install'
|
||||||
contain 'rsnapshot::config'
|
contain 'rsnapshot::config'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
#
|
#
|
||||||
# Installs the rsnapshot package.
|
# Installs the rsnapshot package.
|
||||||
class rsnapshot::install inherits rsnapshot {
|
class rsnapshot::install inherits rsnapshot {
|
||||||
|
case $::operatingsystem {
|
||||||
|
/^CentOS$/: { include epel }
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
package { $rsnapshot::package_name:
|
package { $rsnapshot::package_name:
|
||||||
ensure => $rsnapshot::package_ensure,
|
ensure => $rsnapshot::package_ensure,
|
||||||
}
|
}
|
||||||
|
@ -60,14 +60,6 @@ class rsnapshot::params {
|
|||||||
'/home' => './',
|
'/home' => './',
|
||||||
}
|
}
|
||||||
$config_backup_scripts = {}
|
$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 = {
|
$cron = {
|
||||||
'hourly' => {
|
'hourly' => {
|
||||||
'minute' => '0..59',
|
'minute' => '0..59',
|
||||||
|
Loading…
Reference in New Issue
Block a user