From ed959d72f18f8e99d3084b2249e361e62e6579b3 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 19 Jul 2016 16:59:11 -0400 Subject: [PATCH] Fix bug where getting role vars does not follow the dep chain This bug was introduced in 3ced6d3, where getting vars from a role did not follow the dep chain. This was originally hidden by the fact that we got vars twice (from the block and from the roles directly). Fixes #16729 (cherry picked from commit d8a3feb976d69dbe4c87ce239387fd50936e5061) --- lib/ansible/vars/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 4100fda1caf..686bd31b013 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -334,7 +334,7 @@ class VariableManager: # vars (which will look at parent blocks/task includes) if task: if task._role: - all_vars = combine_vars(all_vars, task._role.get_vars(include_params=False)) + all_vars = combine_vars(all_vars, task._role.get_vars(task._block._dep_chain, include_params=False)) all_vars = combine_vars(all_vars, task.get_vars()) # next, we merge in the vars cache (include vars) and nonpersistent