summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/transform-partial-become.yml
blob: 079d1a0160b1189ba1ed4cf87318e281ab2f1222 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
# The play has become_user and the task has become
# this is fixable, copy the become_user to the task
# and remove from the play
- name: Play 1
  hosts: localhost
  become_user: root
  tasks:
    - name: A block
      block:
        - name: Debug
          ansible.builtin.debug:
            msg: hello
          become: true

# The task has become_user but the play does not
# this is fixable, remove the become_user from the task
- name: Play 2
  hosts: localhost
  tasks:
    - name: A block
      block:
        - name: Debug
          ansible.builtin.debug:
            msg: hello
          become_user: root

# The task has become_user and the play has become
# this is fixable, add become to the task
- name: Play 3
  hosts: localhost
  become: true
  tasks:
    - name: A block
      block:
        - name: Debug
          ansible.builtin.debug:
            msg: hello
          become_user: root

# The play has become_user but has an include
# this is not fixable, the include could be called from multiple playbooks
- name: Play 4
  hosts: localhost
  become_user: root
  tasks:
    - name: A block
      block:
        - name: Debug
          ansible.builtin.debug:
            msg: hello
          become: true

        - name: Include
          ansible.builtin.include_tasks:
            file: ../tasks/partial_become/main.yml