https://github.com/maxgio92/ansible-role-logrotate
Ansible role to manage basic log rotation with Logrotate
https://github.com/maxgio92/ansible-role-logrotate
Last synced: 25 days ago
JSON representation
Ansible role to manage basic log rotation with Logrotate
- Host: GitHub
- URL: https://github.com/maxgio92/ansible-role-logrotate
- Owner: maxgio92
- License: mit
- Created: 2019-06-18T13:18:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-20T10:32:52.000Z (almost 7 years ago)
- Last Synced: 2025-03-21T03:30:20.910Z (about 1 year ago)
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-role-logrotate
Ansible role to manage basic log rotation with Logrotate.
## Usage
```yaml
- hosts: all
tasks:
- include\_role:
name: logrotate
vars:
# ...
```
### Available variables
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| logs\_dir\_path | The path of the directory where to rotate logs | string | | yes |
| logs\_path\_pattern | The pattern to match log files in 'logs\_dir\_path' | string | *.log | no |
| logrotate\_file\_name | The name of the logrotate configuration file | string | | yes |
| rotation\_interval | The interval of the log rotation | string | daily | no |
| retention\_period | Interval count of logs retention | int | 7 | no |
| compress | Old versions of log files are compressed with gzip | bool | yes | no |
| copytruncate | Truncate the original log file in place after creating a copy | bool | yes | no |
| create | Immediately after rotation the log file is created | bool | no | no |
| create_mode | The mode for the created log file in octal | string | | no |
| create_owner | The user name who will own the created log file | string | | no |
| create_group | The group the created log file will belong to | string | | no |
| delay\_compress | Postpone compression of the previous log file to the next rotation cycle | bool | no | no |
| missingok | If the log file is missing, go on to the next one without issuing an error message | bool | yes | no |
| notifempty | Do not rotate the log if it is empty | bool | yes | no |
| rotation\_user | The user that will rotate the logs | string | root | no |
| rotation\_group | The group that will rotate the logs | string | root | no |
| sharedscripts | The scripts are only run once, instead of for each log which is rotated | bool | yes | no
| postrotate_script | The script that will be executed after the log file is rotated | string | | no |