Fix nested include with templating (#85295)
(cherry picked from commit 714f796384)
This commit is contained in:
@ -144,7 +144,9 @@ class IncludedFile:
|
||||
parent_include_dir = parent_include._role_path
|
||||
else:
|
||||
try:
|
||||
parent_include_dir = os.path.dirname(parent_include.args.get('_raw_params'))
|
||||
# FUTURE: Since the parent include path has already been resolved, it should be used here.
|
||||
# Unfortunately it's not currently stored anywhere, so it must be calculated again.
|
||||
parent_include_dir = os.path.dirname(templar.template(parent_include.args.get('_raw_params')))
|
||||
except AnsibleError as e:
|
||||
parent_include_dir = ''
|
||||
display.warning(
|
||||
|
||||
3
test/integration/targets/include_with_templating/aliases
Normal file
3
test/integration/targets/include_with_templating/aliases
Normal file
@ -0,0 +1,3 @@
|
||||
shippable/posix/group4
|
||||
context/controller
|
||||
gather_facts/no
|
||||
@ -0,0 +1,3 @@
|
||||
- include_tasks: "{{ item }}"
|
||||
with_items:
|
||||
- "{{ role_path }}/tests/one.yml"
|
||||
@ -0,0 +1 @@
|
||||
- include_tasks: two.yml
|
||||
@ -0,0 +1 @@
|
||||
- debug:
|
||||
Reference in New Issue
Block a user