2020-01-28 21:44:09 +00:00
|
|
|
---
|
|
|
|
title: logrotate
|
|
|
|
type: docs
|
|
|
|
---
|
|
|
|
|
|
|
|
[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.logrotate) [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.logrotate?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.logrotate) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
|
|
|
|
2020-01-31 10:49:48 +00:00
|
|
|
Setup logrotate.
|
2020-01-28 21:44:09 +00:00
|
|
|
|
|
|
|
* [Default Variables](#default-variables)
|
2020-05-25 21:24:59 +00:00
|
|
|
* [logrotate_config](#logrotate_config)
|
|
|
|
* [logrotate_config_extra](#logrotate_config_extra)
|
|
|
|
* [logrotate_include_dir](#logrotate_include_dir)
|
|
|
|
* [logrotate_options](#logrotate_options)
|
|
|
|
* [logrotate_package](#logrotate_package)
|
2020-01-28 21:44:09 +00:00
|
|
|
* [Dependencies](#dependencies)
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## Default Variables
|
|
|
|
|
|
|
|
### logrotate_config
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
logrotate_config:
|
|
|
|
- name: syslog
|
|
|
|
definitions:
|
|
|
|
- logs:
|
|
|
|
- /var/log/cron
|
|
|
|
- /var/log/maillog
|
|
|
|
- /var/log/messages
|
|
|
|
- /var/log/secure
|
|
|
|
- /var/log/spooler
|
|
|
|
options:
|
|
|
|
- missingok
|
|
|
|
- sharedscripts
|
|
|
|
postrotate:
|
|
|
|
- /usr/bin/systemctl kill -s HUP rsyslog.service >/dev/null 2>&1 || true
|
|
|
|
- name: chrony
|
|
|
|
definitions:
|
|
|
|
- logs:
|
|
|
|
- /var/log/chrony/*.log
|
|
|
|
options:
|
|
|
|
- missingok
|
|
|
|
- nocreate
|
|
|
|
- sharedscripts
|
|
|
|
postrotate:
|
|
|
|
- /usr/bin/chronyc cyclelogs > /dev/null 2>&1 || true
|
|
|
|
- name: wtmp
|
|
|
|
definitions:
|
|
|
|
- logs:
|
|
|
|
- /var/log/wtmp
|
|
|
|
options:
|
|
|
|
- missingok
|
|
|
|
- monthly
|
|
|
|
- create 0664 root utmp
|
|
|
|
- minsize 1M
|
|
|
|
- rotate 1
|
|
|
|
- name: btmp
|
|
|
|
definitions:
|
|
|
|
- logs:
|
|
|
|
- /var/log/btmp
|
|
|
|
options:
|
|
|
|
- missingok
|
|
|
|
- monthly
|
|
|
|
- create 0600 root utmp
|
|
|
|
- rotate 1
|
|
|
|
```
|
|
|
|
|
|
|
|
### logrotate_config_extra
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
logrotate_config_extra: []
|
|
|
|
```
|
|
|
|
|
|
|
|
### logrotate_include_dir
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
logrotate_include_dir: /etc/logrotate.d
|
|
|
|
```
|
|
|
|
|
|
|
|
### logrotate_options
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
logrotate_options:
|
|
|
|
- weekly
|
|
|
|
- rotate 4
|
|
|
|
- create
|
|
|
|
- dateext
|
|
|
|
```
|
|
|
|
|
|
|
|
### logrotate_package
|
|
|
|
|
|
|
|
#### Default value
|
|
|
|
|
|
|
|
```YAML
|
|
|
|
logrotate_package: logrotate
|
|
|
|
```
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
None.
|