Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying openVPN logrotate configuration to keep the logs for a year #765

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
12 changes: 9 additions & 3 deletions roles/gateway/tasks/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
- name: Set log dir SELinux context
command: restorecon -R /var/log/openvpn

- name: Write logrotate conf file
- name: Write logrotate weekly 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 daily conf file
copy:
src: files/openvpn.logrotate-daily
dest: /etc/logrotate.d/openvpn-daily
notify: restart rsyslog

- name: Write rsyslog conf file
Expand Down
Loading