Merge pull request #372 from lgrawet/logrotate-debian

Configure logrotate for Debian
pull/375/head
Pavel Loginov 2023-12-23 12:44:42 +03:00 committed by GitHub
commit b27a160a6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 2 deletions

View File

@ -6,10 +6,18 @@
ignore_errors: yes
notify: restart rsyslog
- name: Installing HAProxy conf for logrotate
- name: Installing HAProxy conf for logrotate on EL
template:
src: /var/www/haproxy-wi/app/scripts/ansible/roles/haproxy/templates/logrotate.conf.j2
dest: /etc/logrotate.d/haproxy.conf
force: no
when: (ansible_facts['os_family'] == "RedHat" or ansible_facts['os_family'] == 'CentOS')
ignore_errors: yes
ignore_errors: yes
- name: Installing HAProxy conf for logrotate on Debian
template:
src: /var/www/haproxy-wi/app/scripts/ansible/roles/haproxy/templates/logrotate-debian.conf.j2
dest: /etc/logrotate.d/haproxy-roxy-wi
force: no
when: (ansible_facts['os_family'] == "Debian" or ansible_facts['os_family'] == 'Ubuntu')
ignore_errors: yes

View File

@ -0,0 +1,35 @@
/var/log/haproxy/access.log {
daily
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
[ ! -x /usr/lib/rsyslog/rsyslog-rotate ] || /usr/lib/rsyslog/rsyslog-rotate
endscript
}
/var/log/haproxy/error.log {
daily
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
[ ! -x /usr/lib/rsyslog/rsyslog-rotate ] || /usr/lib/rsyslog/rsyslog-rotate
endscript
}
/var/log/haproxy/status.log {
daily
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
[ ! -x /usr/lib/rsyslog/rsyslog-rotate ] || /usr/lib/rsyslog/rsyslog-rotate
endscript
}