--- - hosts: web tasks: - name: installation de rsyslog apt: name: rsyslog state: present - name: decommenter la ligne ForwardToSyslog=yes replace: path: /etc/systemd/journald.conf regexp: '^#ForwardToSyslog=yes' replace: 'ForwardToSyslog=yes' notify: restart journald - name: serveur distant est present lineinfile: path: /etc/rsyslog.conf line: '*.*@192.168.0.21:514' create: yes notify: restart rsyslog handlers: - name: restart journald service: name: systemd.journald state: restarted - name: restart rsyslog service: name: rsyslog state: restarted