Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md: Hiera example #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -188,6 +190,8 @@ class { '::logrotate':

## Examples

### Puppet

```puppet
logrotate::conf { '/etc/logrotate.conf':
rotate => 10,
Expand Down Expand Up @@ -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: '[email protected]'
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.
Expand Down