summaryrefslogtreecommitdiffstats
path: root/test/become-user-without-become-success.yml
blob: a8d64daab047e8638fb1bd4800d5a4fef4f00980 (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
- hosts: localhost
  become_user: root
  become: true

  tasks:
  - debug:
      msg: hello

- hosts: localhost

  tasks:
  - command: whoami
    become_user: postgres
    become: true

- hosts: localhost
  become: true

  tasks:
  - name: Accepts a become from higher scope
    command: whoami
    become_user: postgres

- hosts: localhost
  become_user: postgres

  tasks:
  - name: Accepts a become from a lower scope
    command: whoami
    become: true