summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/rule-partial-become-without-become-pass.yml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--examples/playbooks/rule-partial-become-without-become-pass.yml35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/playbooks/rule-partial-become-without-become-pass.yml b/examples/playbooks/rule-partial-become-without-become-pass.yml
new file mode 100644
index 0000000..e1ae189
--- /dev/null
+++ b/examples/playbooks/rule-partial-become-without-become-pass.yml
@@ -0,0 +1,35 @@
+---
+- hosts: localhost
+ become_user: root
+ become: true
+
+ tasks:
+ - ansible.builtin.debug:
+ msg: hello
+
+- hosts: localhost
+
+ tasks:
+ - name: Foo
+ ansible.builtin.command: whoami
+ become_user: postgres
+ become: true
+ changed_when: false
+
+- hosts: localhost
+ become: true
+
+ tasks:
+ - name: Accepts a become from higher scope
+ ansible.builtin.command: whoami
+ become_user: postgres
+ changed_when: false
+
+- hosts: localhost
+ become_user: postgres
+
+ tasks:
+ - name: Accepts a become from a lower scope
+ ansible.builtin.command: whoami
+ become: true
+ changed_when: false