summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/rule-partial-become-without-become-pass.yml
blob: c01b1410a174837ff77d5e9dffe8eb48087e9724 (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
36
37
38
39
---
- name: Test play
  hosts: localhost
  become_user: root
  become: true

  tasks:
    - name: Debug
      ansible.builtin.debug:
        msg: hello

- name: Test play
  hosts: localhost
  tasks:
    - name: Foo
      ansible.builtin.command: whoami
      become_user: postgres
      become: true
      changed_when: false

- name: Test play
  hosts: localhost

  tasks:
    - name: Accepts a become from higher scope
      ansible.builtin.command: whoami
      changed_when: false

- name: Test play
  hosts: localhost
  become_user: postgres
  become: true

  tasks:
    - name: Accepts a become from a lower scope
      ansible.builtin.command: whoami
      become: true
      become_user: root
      changed_when: false