summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/omit/75692.yml
blob: 5ba8a2df1b71724714e8ebe325618051bbc35a19 (plain)
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
30
31
- name: omit should reset to 'absent' or same context, not just 'default' value
  hosts: testhost
  gather_facts: false
  become: yes
  # become_user needed at play level for testing this behavior
  become_user: nobody
  roles:
    - name: setup_test_user
      become_user: root
  tasks:
    - shell: whoami
      register: inherited

    - shell: whoami
      register: explicit_no
      become: false

    - shell: whoami
      register: omited_inheritance
      become: '{{ omit }}'

    - shell: whoami
      register: explicit_yes
      become: yes

    - name: ensure omit works with inheritance
      assert:
        that:
          - inherited.stdout == omited_inheritance.stdout
          - inherited.stdout == explicit_yes.stdout
          - inherited.stdout != explicit_no.stdout