Skip to content
Snippets Groups Projects
Commit 935be638 authored by Benjamin Graillot's avatar Benjamin Graillot Committed by Benjamin Graillot
Browse files

[rsyslog-server] rotate logs and install relp module

parent f750f507
No related branches found
No related tags found
1 merge request!167[rsyslog-server] rotate logs and install relp module
---
- name: Install common tools
apt:
update_cache: true
install_recommends: false
name:
- rsyslog-relp
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Deploy logrotate cablage config
template:
src: logrotate.d/crans.j2
dest: /etc/logrotate.d/crans
mode: 0644
owner: root
group: root
- name: Deploy rsyslog cablage config
template:
src: rsyslog.d/30-cablage.conf.j2
......
{{ ansible_header | comment }}
# Logs Crans
# Logs pour le cablage
/pool/logs/tealc/cablage/global.log {
daily
rotate 365
compress
notifempty
missingok
create 640 root adm
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
# Logs centralisés
# FreeRADIUS
/pool/logs/tealc/freeradius/*.log {
weekly
rotate 365
compress
delaycompress
notifempty
missingok
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
# Logs des bornes et des switches
/pool/logs/tealc/wifi/global.log {
daily
rotate 365
compress
notifempty
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
/pool/logs/tealc/filaire/global.log {
daily
rotate 365
compress
notifempty
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
{{ ansible_header | comment }}
$template CablageFileFormat,"%TIMESTAMP:::date-rfc3339% %fromhost% %syslogtag%%msg%\\n"
# Logs des switches
if $fromhost-ip startswith '172.16.33.' then /pool/logs/tealc/cablage/global.log; CablageFileFormat
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment