diff --git a/README.md b/README.md index 5bdb92f..f12518e 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ The only thing you'll need to deal with, this type configures a logrotate rule. Using this type will automatically include a private class that will install and configure logrotate for you. +**Important**: in Hiera, use logrotate::rules (rule**s**, not rule) + ``` namevar - The String name of the rule. path - The path(s) to the log file(s) to be rotated. May be a @@ -188,6 +190,8 @@ class { '::logrotate': ## Examples +### Puppet + ```puppet logrotate::conf { '/etc/logrotate.conf': rotate => 10, @@ -220,6 +224,47 @@ logrotate::rule { 'apache': } ``` +### Hiera + +**Important**: in Hiera, use logrotate::rules (rule**s**, not rule) + +```yaml +logrotate::config: + rotate: 10 + rotate_every: 'week' + ifempty: true + dateext: true + +logrotate::rules: + messages: + path: '/var/log/messages' + rotate: 5 + rotate_every: 'week' + postrotate: '/usr/bin/killall -HUP syslogd' + servicelogs: + path: ['/var/log/this-service.log', '/var/log/that-app.log'] + rotate: 5 + rotate_every: 'day' + postrotate: '/usr/bin/kill -HUP `cat /run/syslogd.pid`' + apache: + path: '/var/log/httpd/*.log' + rotate: 5 + mail: 'test@example.com' + size: '100k' + sharedscripts: true + postrotate: '/etc/init.d/httpd restart' +``` + +### Result +This example will create/edit these files: +``` +├── logrotate.conf +└── logrotate.d +    ├── apache +    ├── messages +    └── servicelogs +``` + ## Authors and Module History Puppet-logrotate has been maintained by VoxPupuli since version 2.0.0.