1
0
Fork 0
forked from infra/ansible

HAProxy/Rsyslog: fix logging to the rsyslog UDP port that haproxy expects

Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
This commit is contained in:
Greg Sutcliffe 2025-10-02 11:14:11 +01:00 committed by kevin
commit 69645f5da5
4 changed files with 11 additions and 3 deletions

View file

@ -16,8 +16,8 @@ module(load="imjournal" # provides access to the systemd journal
# Provides UDP syslog reception
# for parameters see http://www.rsyslog.com/doc/imudp.html
#module(load="imudp") # needs to be done just once
#input(type="imudp" port="514")
module(load="imudp") # needs to be done just once
input(type="imudp" port="514")
# Provides TCP syslog reception
# for parameters see http://www.rsyslog.com/doc/imtcp.html

View file

@ -0,0 +1 @@
local0.* /var/log/haproxy.log

View file

@ -109,6 +109,13 @@
- haproxy
- selinux
- name: Install our rsyslog drop-in for where to send local0 messages
ansible.builtin.copy: src=rsyslog.conf dest=/etc/rsyslog.d/haproxy.conf
notify:
- Restart rsyslog
tags:
- haproxy
- rsyslogd
- name: Check haproxy cfg to make sure it is valid
ansible.builtin.command: haproxy -c -f /etc/haproxy/haproxy.cfg

View file

@ -1,7 +1,7 @@
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0 warning
log 127.0.0.1:514 local0 warning
maxconn 4096
chroot /var/lib/haproxy
user haproxy