--- - name: "Rsyslog | Disable logging of IP addresses" ansible.builtin.copy: src: rsyslog.d/mail.conf dest: /etc/rsyslog.d/mail.conf mode: "0644" notify: restart rsyslog - name: "Rsyslog | Disable mail logging to syslog" ansible.builtin.replace: path: /etc/rsyslog.conf regexp: "^\\*\\.\\*(?!.*(mail\\.none).*$).*" replace: "*.*;auth,authpriv.none,mail.none -/var/log/syslog" notify: restart rsyslog