mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
Make v2 playbook class attributes inheritable
Also fixing some other become-related things
This commit is contained in:
parent
8d8c4c0615
commit
393246fdd3
14 changed files with 152 additions and 51 deletions
1
v2/samples/roles/test_become_r1/meta/main.yml
Normal file
1
v2/samples/roles/test_become_r1/meta/main.yml
Normal file
|
@ -0,0 +1 @@
|
|||
allow_duplicates: yes
|
2
v2/samples/roles/test_become_r1/tasks/main.yml
Normal file
2
v2/samples/roles/test_become_r1/tasks/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
- debug: msg="this is test_become_r1"
|
||||
- command: whoami
|
3
v2/samples/roles/test_become_r2/meta/main.yml
Normal file
3
v2/samples/roles/test_become_r2/meta/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
allow_duplicates: yes
|
||||
dependencies:
|
||||
- test_become_r1
|
2
v2/samples/roles/test_become_r2/tasks/main.yml
Normal file
2
v2/samples/roles/test_become_r2/tasks/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
- debug: msg="this is test_become_r2"
|
||||
- command: whoami
|
|
@ -1,8 +1,14 @@
|
|||
- hosts: all
|
||||
gather_facts: no
|
||||
roles:
|
||||
- { role: test_become_r2 }
|
||||
- { role: test_become_r2, sudo_user: testing }
|
||||
tasks:
|
||||
- command: whoami
|
||||
- command: whoami
|
||||
become_user: testing
|
||||
- block:
|
||||
- command: whoami
|
||||
- block:
|
||||
- command: whoami
|
||||
become_user: testing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue