source: trunk/puppet/manifests/classes/cronapt.pp @ 495

Last change on this file since 495 was 183, checked in by sebas, 16 years ago

clean up

File size: 1.1 KB
RevLine 
[175]1#
2#  example:
3#    cronapt::mailon-mailto { dist:
4#       mailon => "upgrade",
[183]5#       mailto => "seguridad@localhost"
[175]6#    }
7
8define cronapt::mailon-mailto ( $mailon, $mailto ) {
9        include cronapt
10        # the following file needs to have the same name as the action conf file.
11        file { "/etc/cron-apt/config.d/4-upgrade":
12        ensure => "present",
13        content => "MAILON=\"$mailon\"\nMAILTO=\"$mailto\"\n",
14        require => Package["cron-apt"]
15        }
16}
17
18class cronapt {
[159]19        package { "cron-apt": ensure => installed }
20
21        file { "/etc/cron-apt/action.d/3-download":
22        ensure => absent,
23        require => Package["cron-apt"]
24        }
25
26        file { "/etc/cron-apt/action.d/4-upgrade":
27        ensure => "present",
28        content => "upgrade -y -o APT::Get::Show-Upgraded=true\n",
29        require => Package["cron-apt"]
30        }
31
32        file { "/etc/cron-apt/action.d/5-clean":
33        ensure => "present",
34        content => "autoclean -y -q -q\n",
35        require => Package["cron-apt"]
36        }
37
38        file { "/etc/cron.d/cron-apt":
39        content => "# cron-apt cron job, managed by puppet\n0 8 * * * root test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt\n",
40        ensure => present,
41        require => Package['cron-apt']
42        }
43}
Note: See TracBrowser for help on using the repository browser.