summaryrefslogtreecommitdiff
path: root/lib/ansible/playbook/included_file.py
diff options
context:
space:
mode:
authorPhil Nelson <phil@fullyint.com>2017-06-08 22:47:21 -0600
committerJames Cammarata <jimi@sngx.net>2017-06-08 23:47:21 -0500
commiteb349cb2017ebfecf68487b3c68fb47a15772ee8 (patch)
tree677df40d00451621f012f63217b3e53061ce1a9a /lib/ansible/playbook/included_file.py
parent64a9794997ed631ab4346171bf10aacc0a7e219e (diff)
downloadansible-eb349cb2017ebfecf68487b3c68fb47a15772ee8.tar.gz
Template parent include path before finding its dirname (#23202)
Given parent include path "{{ var | default('path/file.yml') }}" os.path.dirname(parent_include_path) yields {{ var | default('path/ which is incorrect in itself but also causes templating errors due to unbalanced quotes. Fix both problems by templating parent include path before finding its dirname.
Diffstat (limited to 'lib/ansible/playbook/included_file.py')
-rw-r--r--lib/ansible/playbook/included_file.py2
1 files changed, 1 insertions, 1 deletions
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):