Added yum::cron::download for automatic downloading of updates

This commit is contained in:
Ossi Salmi 2012-02-12 18:58:55 +02:00
parent ccf2db2aa7
commit 043c7f91b1

View file

@ -28,6 +28,42 @@ class yum::updatesd {
}
# Cron job for automatic downloading of updates
#
class yum::cron::download {
include yum::plugin::downloadonly
cron { "yum-cron-download":
ensure => present,
command => "yum -d 0 -e 0 -y --downloadonly update",
user => "root",
hour => 3,
minute => fqdn_rand(60),
require => Package["yum-plugin-downloadonly"],
}
}
# Install downloadonly plugin
#
class yum::plugin::downloadonly {
package { "yum-plugin-downloadonly":
ensure => installed,
name => $operatingsystem ? {
"centos" => $operatingsystemrelease ? {
/^[1-5]/ => "yum-downloadonly",
default => "yum-plugin-downloadonly",
},
default => "yum-plugin-downloadonly",
},
}
}
# Common prequisites for yum
#
class yum::common {