summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/rule-partial-become-without-become-pass.yml
blob: e1ae189f63a5a40433a70c68f5dc0aa42cee7b60 (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
32
33
34
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