Sha256: a4ea3df3b46ce89926a541c9c8ff63679837bc1668ba1fe18ce4587225e1ae21

Contents?: true

Size: 1.76 KB

Versions: 72

Compression:

Stored size: 1.76 KB

Contents

# logrotate

![Build Status](https://travis-ci.org/nickhammond/ansible-logrotate.svg?branch=master)

Installs logrotate and provides an easy way to setup additional logrotate scripts by
specifying a list of directives.

## Requirements

None

## Role Variables

**logrotate_scripts**: A list of logrotate scripts and the directives to use for the rotation.

* name - The name of the script that goes into /etc/logrotate.d/
* path - Path to point logrotate to for the log rotation
* options - List of directives for logrotate, view the logrotate man page for specifics
* scripts - Dict of scripts for logrotate (see Example below)

```
logrotate_scripts:
  - name: rails
    path: "/srv/current/log/*.log"
    options:
      - weekly
      - size 25M
      - missingok
      - compress
      - delaycompress
      - copytruncate
```

## Dependencies

None

## Example Playbook

Setting up logrotate for additional Nginx logs, with postrotate script (assuming this role is located in `roles/logrotate`).

```
- role: logrotate
  logrotate_scripts:
    - name: nginx
      path: /var/log/nginx/*.log
      options:
        - weekly
        - size 25M
        - rotate 7
        - missingok
        - compress
        - delaycompress
        - copytruncate
      scripts:
        postrotate: "[ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`"
```

## License

[BSD](https://raw.githubusercontent.com/nickhammond/logrotate/master/LICENSE)

## Author Information

* [nickhammond](https://github.com/nickhammond) | [www](http://www.nickhammond.com) | [twitter](http://twitter.com/nickhammond)
* [bigjust](https://github.com/bigjust)
* [steenzout](https://github.com/steenzout)
* [jeancornic](https://github.com/jeancornic)
* [duhast](https://github.com/duhast)
* [kagux](https://github.com/kagux)

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
subspace-3.0.13 ansible/roles/logrotate/README.md
subspace-3.0.12 ansible/roles/logrotate/README.md
subspace-3.0.11 ansible/roles/logrotate/README.md
subspace-3.0.10 ansible/roles/logrotate/README.md
subspace-3.0.9 ansible/roles/logrotate/README.md
subspace-3.0.6 ansible/roles/logrotate/README.md
subspace-3.0.5 ansible/roles/logrotate/README.md
subspace-3.0.4 ansible/roles/logrotate/README.md
subspace-3.0.3 ansible/roles/logrotate/README.md
subspace-3.0.2 ansible/roles/logrotate/README.md
subspace-3.0.0 ansible/roles/logrotate/README.md
subspace-2.5.10 ansible/roles/logrotate/README.md
subspace-3.0.0.rc1 ansible/roles/logrotate/README.md
subspace-2.5.9 ansible/roles/logrotate/README.md
subspace-2.5.8 ansible/roles/logrotate/README.md
subspace-2.5.7 ansible/roles/logrotate/README.md
subspace-2.5.6 ansible/roles/logrotate/README.md
subspace-2.5.5 ansible/roles/logrotate/README.md
subspace-2.5.4 ansible/roles/logrotate/README.md
subspace-2.5.3 ansible/roles/logrotate/README.md