OLD | NEW |
(Empty) | |
| 1 # == Type: logrotate::config |
| 2 # |
| 3 # A shorthand wrapper that sets up a logrotate configuration file resources |
| 4 # with the same $title, and properly configured attributes like e.g. $path. |
| 5 # |
| 6 # === Parameters: |
| 7 # |
| 8 # [*content*] |
| 9 # Translates directly into the configuration file content. |
| 10 # Mutually exclusive with $source. |
| 11 # |
| 12 # [*ensure*] |
| 13 # Any value beside 'absent' and 'purged' will ensure the configuration |
| 14 # file being 'present'. |
| 15 # |
| 16 # [*name*] |
| 17 # The actual configuration file base name (defaults to $title). |
| 18 # |
| 19 # [*source*] |
| 20 # Translates directly into the configuration file source. |
| 21 # Mutually exclusive with $content. |
| 22 # |
| 23 # === Examples: |
| 24 # |
| 25 # logrotate::config {'gamma': |
| 26 # ensure => 'present', |
| 27 # source => 'puppet:///logrotate.conf', |
| 28 # } |
| 29 # |
| 30 # logrotate::config {'delta': |
| 31 # content => template('custom/logrotate.erb'), |
| 32 # ensure => 'present', |
| 33 # } |
| 34 # |
| 35 # logrotate::config {'void-alpha': |
| 36 # ensure => 'absent', |
| 37 # name => 'alpha', |
| 38 # } |
| 39 # |
| 40 define logrotate::config ( |
| 41 $content = undef, |
| 42 $ensure = 'present', |
| 43 $source = undef, |
| 44 ) { |
| 45 |
| 46 file {$title: |
| 47 content => $content, |
| 48 ensure => $ensure ? { |
| 49 /^(absent|purged)$/ => 'absent', |
| 50 default => 'present', |
| 51 }, |
| 52 group => 'root', |
| 53 mode => 0644, |
| 54 owner => 'root', |
| 55 path => "/etc/logrotate.d/$name", |
| 56 } |
| 57 } |
OLD | NEW |