- hosts: all any_errors_fatal: true tasks: - name: integration/become/sudo_nonexistent.yml assert: that: true - name: Verify behaviour for non-existent accounts. shell: whoami become: true become_user: slartibartfast ignore_errors: true register: out - name: Verify raw module output. assert: that: | out.failed and ( ('sudo: unknown user: slartibartfast' in out.msg) or ('sudo: unknown user: slartibartfast' in out.module_stderr) )