From b9f7f582d116d516a5fcad80dee25c341650676e Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 1 May 2018 10:16:59 -0400 Subject: [PATCH] remove properties from vars in include_role (#38968) * remove properties from vars in include_role * also from_ args --- lib/ansible/playbook/included_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/playbook/included_file.py b/lib/ansible/playbook/included_file.py index a2261fb39ee..7681ba65740 100644 --- a/lib/ansible/playbook/included_file.py +++ b/lib/ansible/playbook/included_file.py @@ -149,7 +149,7 @@ class IncludedFile: inc_file = IncludedFile(include_file, include_variables, original_task) else: # template the included role's name here - role_name = include_variables.get('name', include_variables.get('role', None)) + role_name = include_variables.pop('name', include_variables.pop('role', None)) if role_name is not None: role_name = templar.template(role_name) @@ -158,7 +158,7 @@ class IncludedFile: for from_arg in new_task.FROM_ARGS: if from_arg in include_variables: from_key = from_arg.replace('_from', '') - new_task._from_files[from_key] = templar.template(include_variables[from_arg]) + new_task._from_files[from_key] = templar.template(include_variables.pop(from_arg)) inc_file = IncludedFile(role_name, include_variables, new_task, is_role=True)