Merge pull request 'fix: Configure rsyslog' (#3) from rsyslogFix into master

Reviewed-on: #3
This commit is contained in:
pulsar89.5 2024-04-18 19:49:53 +00:00
commit 91e8739aed
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

@ -11,3 +11,14 @@
- systemd-container - systemd-container
state: present state: present
become: true become: true
- 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 %}