Defined Type: tmpreaper::dir

Defined in:
modules/tmpreaper/manifests/dir.pp

Overview

Define: tmpreaper::dir

Add a directory to the set of directories purged by tmpreaper's daily cron script.

Parameters

ensure

'present' means that the directory will be managed by tmpreaper; 'absent' means it will not be. The value of this parameter does

not create or destroy the directory on disk.
path

Path to tidy. Defaults to the resource name.

Example

tmpreaper::dir { '/tmp':
  ensure => present,
}

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: present)
  • path (Stdlib::Unixpath) (defaults to: $name)


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'modules/tmpreaper/manifests/dir.pp', line 22

define tmpreaper::dir(
    Wmflib::Ensure   $ensure = present,
    Stdlib::Unixpath $path   = $name,
) {
    include tmpreaper

    $safe_name = regsubst($title, '\W', '-', 'G')
    $safe_path = regsubst($path, '/?$', '/')

    file_line { "tmpreaper_dir_${safe_name}":
        ensure  => $ensure,
        line    => "TMPREAPER_DIRS=\"\${TMPREAPER_DIRS} ${safe_path}.\"",
        path    => '/etc/tmpreaper.conf',
        require => Package['tmpreaper'],
    }
}