Skip to content

Commit

Permalink
Update vars for loop_control on each loop iteration (fixes ansible#38899
Browse files Browse the repository at this point in the history
) (ansible#39818)

(cherry picked from commit 01e8139)
  • Loading branch information
agaffney committed May 7, 2018
1 parent bf1436c commit 3a07a3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ansible/executor/task_executor.py
Expand Up @@ -302,6 +302,9 @@ def _run_loop(self, items):
if index_var:
task_vars[index_var] = item_index

# Update template vars to reflect current loop iteration
templar.set_available_variables(task_vars)

# pause between loop iterations
if loop_pause and ran_once:
try:
Expand Down

0 comments on commit 3a07a3e

Please sign in to comment.