fix: Configure rsyslog

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

View File

@ -28,6 +28,12 @@ $ ansible-galaxy install -fr requirements.yml
## Variables ## Variables
### podman_configure_rsyslog
Désactive les messages du programme *podman* et des programmes dans les conteneurs si ils portent le nom du conteneur.
<span style="text-decoration: underline">Valeur par défaut:</span> `true` (activé, `false` pour désactiver)
### podman_containers ### podman_containers
Définition des conteneurs à déployer. Définition des conteneurs à déployer.

View File

@ -1,6 +1,8 @@
--- ---
# defaults file for podman # defaults file for podman
podman_configure_rsyslog: true
podman_containers: [] podman_containers: []
# Exemple: # Exemple:
# - image: docker.io/wallabag/wallabag:latest # - image: docker.io/wallabag/wallabag:latest

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,14 @@
scope: user scope: user
become: true become: true
become_user: "{{ container_user }}" become_user: "{{ container_user }}"
- name: Déployer la configuration de rsyslog
ansible.builtin.template:
src: templates/rsyslog.conf.j2
dest: /etc/rsyslog.d/10-podman.conf
owner: root
group: root
mode: u=rw,g=r,o=r
when: podman_configure_rsyslog
become: true
notify: Redémarrer rsyslog.service

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
{% endfor %}