mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 00:22:10 +02:00
Fix nested import_tasks when the parent import contains a template (#85599)
* Test nested import_tasks when the parent import contains a template * Fix templating the parent_include.args
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- import_tasks - fix templating parent include arguments.
|
||||
@@ -169,6 +169,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
||||
if not isinstance(parent_include, TaskInclude):
|
||||
parent_include = parent_include._parent
|
||||
continue
|
||||
parent_include.post_validate(templar=templar)
|
||||
parent_include_dir = os.path.dirname(parent_include.args.get('_raw_params'))
|
||||
if cumulative_path is None:
|
||||
cumulative_path = parent_include_dir
|
||||
|
||||
@@ -9,3 +9,5 @@
|
||||
- assert:
|
||||
that:
|
||||
- nested_adjacent_count|int == 2
|
||||
|
||||
- import_tasks: "{{ role_path }}/tests/main.yml"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
- import_tasks: tests_relative.yml
|
||||
Reference in New Issue
Block a user