File: sudo_nonexistent.yml

package info (click to toggle)
python-mitogen 0.3.36-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,708 kB
  • sloc: python: 24,457; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (29 lines) | stat: -rw-r--r-- 938 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
- name: integration/become/sudo_nonexistent.yml
  hosts: test-targets
  tasks:

    - name: Verify behaviour for non-existent accounts.
      shell: whoami
      become: true
      become_user: slartibartfast
      ignore_errors: true
      register: out
      when:
        - become_unpriv_available

    - 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.
          - >-
            (out.module_stderr | default(out.module_stdout, true) | default(out.msg, true)) is search('sudo: unknown user:? slartibartfast')
            or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version == '6.10')
        fail_msg: |
          out={{ out }}
      when:
        - become_unpriv_available
  tags:
    - sudo
    - sudo_nonexistent