Skip to content

Commit

Permalink
Changing openVPN logrotate configuration to keep the logs for a year …
Browse files Browse the repository at this point in the history
…in a weekly rotation and to keep for a month in a daily rotation

Fixes: https://ibm.monday.com/boards/5591222586/pulses/8354436354

Signed-off-by: Fernando <[email protected]>
  • Loading branch information
falcocer-ibm committed Jan 31, 2025
1 parent 2148524 commit 54fca6a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/var/log/openvpn/*.log {
daily
rotate 90
rotate 30
compress
missingok
copytruncate
Expand Down
9 changes: 9 additions & 0 deletions roles/gateway/files/openvpn.logrotate-weekly
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/var/log/openvpn/*.log {
weekly
rotate 52
compress
missingok
copytruncate
notifempty
create 644 nobody nobody
}
10 changes: 8 additions & 2 deletions roles/gateway/tasks/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@

- name: Write logrotate conf file
copy:
src: files/openvpn.logrotate
dest: /etc/logrotate.d/openvpn
src: files/openvpn.logrotate-weekly
dest: /etc/logrotate.d/openvpn-weekly
notify: restart rsyslog

- name: Write logrotate conf file
copy:
src: files/openvpn.logrotate-daily
dest: /etc/logrotate.d/openvpn-daily
notify: restart rsyslog

- name: Write rsyslog conf file
Expand Down

0 comments on commit 54fca6a

Please sign in to comment.