You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/ansible/integration/become/sudo_nonexistent.yml

22 lines
735 B
YAML

- 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')