Defined Type: logrotate::add

Defined in:
manifests/rule.pp

Overview

Add a LogRotate Configuration

If options have a 'no' variant, then the no variant will be set if you set the primary value to false

The logrotate(5) man page should be referenced for any undocumented parameter.

Parameters:

  • name (String)

    Directly translates to the name of the file

  • log_files (Array[String])

    The log file strings for all logs to be affected by this stanza

  • compress (Boolean) (defaults to: true)
  • compresscmd (Optional[String]) (defaults to: undef)
  • uncompresscmd (Optional[String]) (defaults to: undef)
  • compressext (Optional[String]) (defaults to: undef)
  • compressoptions (Optional[String]) (defaults to: undef)
  • copy (Boolean) (defaults to: false)
  • copytruncate (Boolean) (defaults to: false)
  • create (Pattern['\d{4} .+ .+']) (defaults to: '0640 root root')
  • rotate_period (Optional[Enum['daily','weekly','monthly','yearly']]) (defaults to: undef)
  • dateext (Boolean) (defaults to: true)
  • dateformat (String) (defaults to: '-%Y%m%d.%s')
  • delaycompress (Optional[Boolean]) (defaults to: undef)
  • extension (Optional[String]) (defaults to: undef)
  • ifempty (Boolean) (defaults to: false)
  • ext_include (Array[String]) (defaults to: [])

    Corresponds to the include logrotate configuration since it is a reserved word in Puppet

  • mail (Simplib::EmailAddress) (defaults to: undef)
  • maillast (Boolean) (defaults to: true)
  • maxage (Integer[0]) (defaults to: undef)
  • minsize (Integer[0]) (defaults to: undef)
  • missingok (Boolean) (defaults to: false)
  • olddir (Optional[Stdlib::Absolutepath]) (defaults to: undef)
  • postrotate (Optional[String]) (defaults to: undef)
  • prerotate (Optional[String]) (defaults to: undef)
  • firstaction (Optional[String]) (defaults to: undef)
  • lastaction (Optional[String]) (defaults to: undef)
  • rotate (Integer[0]) (defaults to: 4)
  • size (Optional[Integer[0]]) (defaults to: undef)
  • sharedscripts (Boolean) (defaults to: true)
  • start (Integer[0]) (defaults to: 1)
  • tabooext (Array[String]) (defaults to: [])

See Also:

  • logrotate(5)

Author:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'manifests/rule.pp', line 54

define logrotate::add (
  Array[String]                                       $log_files,
  Boolean                                             $compress        = true,
  Optional[String]                                    $compresscmd     = undef,
  Optional[String]                                    $uncompresscmd   = undef,
  Optional[String]                                    $compressext     = undef,
  Optional[String]                                    $compressoptions = undef,
  Boolean                                             $copy            = false,
  Boolean                                             $copytruncate    = false,
  Pattern['\d{4} .+ .+']                              $create          = '0640 root root',
  Optional[Enum['daily','weekly','monthly','yearly']] $rotate_period   = undef,
  Boolean                                             $dateext         = true,
  String                                              $dateformat      = '-%Y%m%d.%s',
  Optional[Boolean]                                   $delaycompress   = undef,
  Optional[String]                                    $extension       = undef,
  Boolean                                             $ifempty         = false,
  Array[String]                                       $ext_include     = [],
  Simplib::EmailAddress                               $mail            = undef,
  Boolean                                             $maillast        = true,
  Integer[0]                                          $maxage          = undef,
  Integer[0]                                          $minsize         = undef,
  Boolean                                             $missingok       = false,
  Optional[Stdlib::Absolutepath]                      $olddir          = undef,
  Optional[String]                                    $postrotate      = undef,
  Optional[String]                                    $prerotate       = undef,
  Optional[String]                                    $firstaction     = undef,
  Optional[String]                                    $lastaction      = undef,
  Integer[0]                                          $rotate          = 4,
  Optional[Integer[0]]                                $size            = undef,
  Boolean                                             $sharedscripts   = true,
  Integer[0]                                          $start           = 1,
  Array[String]                                       $tabooext        = []
) {
  file { "/etc/logrotate.d/${name}":
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('logrotate/conf.erb')
  }
}