--- - hosts: all tasks: - name: send root mail command: cmd: mail -s "ansible test {{ inventory_hostname }}" root stdin: test