Skip to content

Commit

Permalink
Merge pull request arillso#11 from bessonovevgen/enable-hourly-rotation
Browse files Browse the repository at this point in the history
enable hourly logrotate
  • Loading branch information
sbaerlocher authored Jul 23, 2019
2 parents 1119ffb + 4ae2a5c commit e289506
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ Path to the imclude files
```yml
logrotate_include_dir: /etc/logrotate.d
```
### logrotate_use_hourly_rotation
Enable hourly rotation with cron
```yml
logrotate_use_hourly_rotation: false
```
### logrotate options
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ logrotate_include_dir: /etc/logrotate.d
# package name to install logrotate.
logrotate_package: logrotate

# Enable hourly rotation with cron.
logrotate_use_hourly_rotation: false

# logroate for wtmp
logrotate_wtmp:
logs:
Expand Down
6 changes: 6 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@
- '{{ logrotate_applications }}'
tags:
- configuration

- name: Symlink for hourly rotation
file:
path: "/etc/cron.hourly/logrotate"
src: "/etc/cron.daily/logrotate"
state: "{{ 'link' if logrotate_use_hourly_rotation else 'absent' }}"
3 changes: 3 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# vars file for arillso.logrotate
hourly_link_state: absent

0 comments on commit e289506

Please sign in to comment.