- hosts: adm tasks: - name: on active le module imudp dans /etc/rsyslog.conf replace: path: /etc/rsyslog.conf regexp: '^#module\(load="imudp"\)' replace: 'module(load="imudp")' notify: - restart rsyslog - name: on decommente la ligne input type imudp port 514 dans /etc/rsyslog.conf 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 state: restarted