Tag Archives: schedule

Puppet: ubuntu update

This puppet config will make apt-get update && apt-get upgrade once a day between 2 and 4 hours.
Put it in manifests/site.pp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin' }

class update {
        schedule { 'maintenance':
                  range  => "2 - 4",
                  period => daily,
                  repeat => 1,
        }

        exec { "upgrade_packages":
                command => "apt-get upgrade -q=2 -y",
                group => "root",
                user => "root",
                schedule => 'maintenance',
                onlyif => ["apt-get update"]
        }
}

node default {
        include update
}