summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/omit/75692.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
commit8a754e0858d922e955e71b253c139e071ecec432 (patch)
tree527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/omit/75692.yml
parentInitial commit. (diff)
downloadansible-core-upstream.tar.xz
ansible-core-upstream.zip
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/omit/75692.yml')
-rw-r--r--test/integration/targets/omit/75692.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/integration/targets/omit/75692.yml b/test/integration/targets/omit/75692.yml
new file mode 100644
index 0000000..b4000c9
--- /dev/null
+++ b/test/integration/targets/omit/75692.yml
@@ -0,0 +1,31 @@
+- name: omit should reset to 'absent' or same context, not just 'default' value
+ hosts: testhost
+ gather_facts: false
+ become: yes
+ become_user: nobody
+ roles:
+ - name: setup_test_user
+ become: yes
+ 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