mirror of https://github.com/ansible/ansible.git
Compile role with parents in the task's dependency chain (#75165)
* Use the task dependency chain to compile the role instead of the parent role's _parents list * keep existing role inheritance, but limit it to roles in the current task dependency chain * Test getting role parents recursively by using the current task dependency chain * changelogpull/75762/head
parent
7a76130502
commit
440cf15aeb
@ -0,0 +1,4 @@
|
||||
bugfixes:
|
||||
- include_role - Only inherit from role parents in the current task dependency chain (https://github.com/ansible/ansible/issues/39543).
|
||||
- include_role - Inherit from role parents beyond a depth of 3 (https://github.com/ansible/ansible/issues/47023).
|
||||
- include_role - Inherit from role parents in the order of the task dependency chain.
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
- hosts: all
|
||||
gather_facts: no
|
||||
roles:
|
||||
- 39543_role1
|
||||
- role: 39543_role3
|
||||
when: false
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: all
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- include_role: name=47023_role1
|
@ -0,0 +1,5 @@
|
||||
- debug:
|
||||
msg: 'role1'
|
||||
|
||||
- include_role:
|
||||
name: 39543_role2
|
@ -0,0 +1,2 @@
|
||||
- debug:
|
||||
msg: 'role2'
|
@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- 39543_role1
|
@ -0,0 +1,2 @@
|
||||
- debug:
|
||||
msg: 'role3'
|
@ -0,0 +1 @@
|
||||
my_default: defined
|
@ -0,0 +1 @@
|
||||
- include_role: name=47023_role2
|
@ -0,0 +1 @@
|
||||
my_var: defined
|
@ -0,0 +1 @@
|
||||
- include_role: name=47023_role3
|
@ -0,0 +1 @@
|
||||
- include_role: name=47023_role4
|
@ -0,0 +1,5 @@
|
||||
- debug:
|
||||
msg: "Var is {{ my_var | default('undefined') }}"
|
||||
|
||||
- debug:
|
||||
msg: "Default is {{ my_default | default('undefined') }}"
|
Loading…
Reference in New Issue