Configure logrotate for Debian

pull/372/head
Laurent Grawet 2023-12-22 23:43:46 +01:00
parent b3bea63275
commit d46e76fc4b
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
- 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
}