diff --git a/lib/ansible/playbook/helpers.py b/lib/ansible/playbook/helpers.py index 7b500de44a..c347a80713 100644 --- a/lib/ansible/playbook/helpers.py +++ b/lib/ansible/playbook/helpers.py @@ -169,7 +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_dir = templar.template(os.path.dirname(parent_include.args.get('_raw_params'))) + parent_include_dir = os.path.dirname(templar.template(parent_include.args.get('_raw_params'))) if cumulative_path is None: cumulative_path = parent_include_dir elif not os.path.isabs(cumulative_path): diff --git a/lib/ansible/playbook/included_file.py b/lib/ansible/playbook/included_file.py index 5784ea0650..b9f7b3a25d 100644 --- a/lib/ansible/playbook/included_file.py +++ b/lib/ansible/playbook/included_file.py @@ -101,7 +101,7 @@ class IncludedFile: if not isinstance(parent_include, TaskInclude): parent_include = parent_include._parent continue - parent_include_dir = templar.template(os.path.dirname(parent_include.args.get('_raw_params'))) + parent_include_dir = os.path.dirname(templar.template(parent_include.args.get('_raw_params'))) if cumulative_path is None: cumulative_path = parent_include_dir elif not os.path.isabs(cumulative_path):