| 1 |
# Internal: Install logrotate and configure it to read from /etc/logrotate.d |
| 2 |
# |
| 3 |
# Examples |
| 4 |
# |
| 5 |
# include logrotate::base |
| 6 |
class logrotate::base { |
| 7 |
package { 'logrotate': |
| 8 |
ensure => latest, |
| 9 |
} |
| 10 |
|
| 11 |
File { |
| 12 |
owner => 'root', |
| 13 |
group => 'root', |
| 14 |
require => Package['logrotate'], |
| 15 |
} |
| 16 |
|
| 17 |
file { |
| 18 |
'/etc/logrotate.conf': |
| 19 |
ensure => file, |
| 20 |
mode => '0444', |
| 21 |
source => 'puppet:///modules/logrotate/etc/logrotate.conf'; |
| 22 |
'/etc/logrotate.d': |
| 23 |
ensure => directory, |
| 24 |
mode => '0755'; |
| 25 |
'/etc/cron.daily/logrotate': |
| 26 |
ensure => file, |
| 27 |
mode => '0555', |
| 28 |
source => 'puppet:///modules/logrotate/etc/cron.daily/logrotate'; |
| 29 |
} |
| 30 |
|
| •31 |
case $facts['os']['family'] { |
| 32 |
'Debian': { |
| 33 |
include logrotate::defaults::debian |
| 34 |
} |
| 35 |
'RedHat': { |
| 36 |
include logrotate::defaults::redhat |
| 37 |
} |
| 38 |
'SuSE': { |
| 39 |
include logrotate::defaults::suse |
| 40 |
} |
| 41 |
default: { } |
| 42 |
} |
| 43 |
} |