Fix nested include with templating (#85295)

(cherry picked from commit 714f796384)
pull/85305/head
Matt Clay 6 months ago committed by Matt Davis
parent 0cecfd9877
commit b5a4fe62ed

@ -144,7 +144,9 @@ class IncludedFile:
parent_include_dir = parent_include._role_path parent_include_dir = parent_include._role_path
else: else:
try: 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: except AnsibleError as e:
parent_include_dir = '' parent_include_dir = ''
display.warning( display.warning(

@ -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"
Loading…
Cancel
Save