- name: integration/become/sudo_nonexistent.yml hosts: test-targets any_errors_fatal: true tasks: - 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 # sudo-1.8.6p3-29.el6_10.3 on RHEL & CentOS 6.10 (final release) # removed user/group error messages, as defence against CVE-2019-14287. - >- ('sudo: unknown user: slartibartfast' in out.module_stderr | default(out.msg)) or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version == '6.10') fail_msg: out={{out}}