summaryrefslogtreecommitdiff
path: root/puppet/modules/apt/manifests/cron/base.pp
blob: 39fc3061de9af28fdefb04552c55f4ee95c8cbd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class apt::cron::base {

  package { 'cron-apt': ensure => installed }

  case $apt_cron_hours {
    '': {}
    default: {
      # cron-apt defaults to run every night at 4 o'clock
      # so we try not to run at the same time.
      cron { 'apt_cron_every_N_hours':
        command => 'test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt',
        user    => root,
        hour    => "${apt_cron_hours}",
        minute  => 10,
        require => Package['cron-apt'],
      }
    }
  }

}