From 88e1aa94fa0a0494b9808aaf9adec850444e3dbe Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Sat, 19 Sep 2015 21:51:24 -0400 Subject: [PATCH] Add play context vars to list of variables before post validation Fixes #12437 --- lib/ansible/executor/task_executor.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index df7daa607a..afe96057bf 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -263,11 +263,10 @@ class TaskExecutor: # fields set from the play/task may be based on variables, so we have to # do the same kind of post validation step on it here before we use it. - self._play_context.post_validate(templar=templar) - - # now that the play context is finalized, we can add 'magic' - # variables to the variable dictionary + # We also add "magic" variables back into the variables dict to make sure + # a certain subset of variables exist. self._play_context.update_vars(variables) + self._play_context.post_validate(templar=templar) # Evaluate the conditional (if any) for this task, which we do before running # the final task post-validation. We do this before the post validation due to