From b4504cadc692ae8798b6315adabf4b01f824a01b Mon Sep 17 00:00:00 2001 From: "johan.largy" Date: Tue, 11 Oct 2022 09:21:26 +0200 Subject: [PATCH] ajout script --- sio2/sisr2/40-Ansible/rsyslog-cli.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sio2/sisr2/40-Ansible/rsyslog-cli.yml diff --git a/sio2/sisr2/40-Ansible/rsyslog-cli.yml b/sio2/sisr2/40-Ansible/rsyslog-cli.yml new file mode 100644 index 0000000..debe6d6 --- /dev/null +++ b/sio2/sisr2/40-Ansible/rsyslog-cli.yml @@ -0,0 +1,22 @@ +--- +- hosts: web + tasks: + - name: decommente l'option ForwardToSyslog + replace: + path: /etc/systemd/journald.conf + regexp: '^#ForwardToSyslog=yes' + replace: 'ForwardToSyslog=yes' + backup: true + notify: Restart systemd-journald.service + + - name: Ajoute l'indication de serveur syslog distant si elle n'est pas presente + lineinfile: + path: /etc/rsyslog.conf + line: '*.* @192.168.0.34:514' + create: yes + + handlers: + - name: Restart systemd-journald.service + service: + name: systemd-journald.service + state: restarted