--- - hosts: adm tasks: - name: installation de rsyslog apt: name: rsyslog state: present - name: decommente le chargement du module imudp dans rsyslog.conf replace: path: /etc/rsyslog.conf regexp: '^#module\(load="imudp"\)' replace: 'module(load="imudp")' notify: restart rsyslog - name: decommenter toutes les lignes avec le port 514 udp replace: path: /etc/rsyslog.conf regexp: '^#input\(type="imudp" port="514"\)' replace: 'input(type="imudp" port="514")' notify: restart rsyslog handlers: - name: restart rsyslog service: name: rsyslog.service state: restarted