fix: Configure rsyslog

This commit is contained in:
pulsar89.5 2024-04-18 21:26:32 +02:00
parent 1dd6ac97b9
commit 45cbf68e5c
3 changed files with 27 additions and 0 deletions

8
handlers/main.yml Normal file
View File

@ -0,0 +1,8 @@
---
# handlers file for exim4
- name: Redémarrer rsyslog.service
ansible.builtin.systemd:
state: restarted
name: rsyslog.service
become: true

View File

@ -46,3 +46,13 @@
scope: user
become: true
become_user: "{{ container_user }}"
- name: Déployer la configuration de rsyslog
ansible.builtin.template:
src: rsyslog.j2
dest: /etc/rsyslog.d/10-podman.conf
owner: root
group: root
mode: u=rw,g=r,o=r
become: true
notify: Redémarrer rsyslog.service

9
templates/rsyslog.conf Normal file
View File

@ -0,0 +1,9 @@
# {{ ansible_managed }}
# Don't log podman
:programname, contains, "podman" stop
# Don't log progams inside podman container
{% for container in podman_containers %}
:programname, contains, "{{ container.name }}" stop
{% %}