Skip to content
Snippets Groups Projects
tmpclean.pp 1021 B
Newer Older
Adam Lewenberg's avatar
Adam Lewenberg committed
#
# Clean out /tmp perodically.

class base::tmpclean {
    case $::operatingsystem {
        'debian', 'ubuntu': {
            package { 'tmpreaper': ensure => present }
            file { '/etc/tmpreaper.conf':
                source => 'puppet:///modules/base/tmpclean/etc/tmpreaper.conf',
            }
        }
        'redhat': {
            package { 'tmpwatch': ensure => present }
            file { '/etc/cron.daily/tmpwatch':
                source => 'puppet:///modules/base/tmpclean/etc/cron.daily/tmpwatch',
            }
        }
    }
}

# Used for systems where we don't want tmpreaper running for some reason.  We
# leave the package installed in case someone wants to use it for a different
# purpose.
class base::tmpclean::disabled inherits base::tmpclean {
    case $::operatingsystem {
        'debian', 'ubuntu': {
             file { '/etc/cron.daily/tmpreaper': ensure => absent }
        }
        'redhat': {
            File['/etc/cron.daily/tmpwatch'] { ensure => absent }
        }
    }
}