From 5adcd7054b0997497f59cb4decaad011f27c44aa Mon Sep 17 00:00:00 2001
From: James Cammarata <jimi@sngx.net>
Date: Mon, 31 Aug 2015 22:10:34 -0400
Subject: [PATCH] Allow setup to run when using --start-at-task

Fixes #12147
---
 lib/ansible/executor/play_iterator.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/ansible/executor/play_iterator.py b/lib/ansible/executor/play_iterator.py
index 89849988e35..340f8efd548 100644
--- a/lib/ansible/executor/play_iterator.py
+++ b/lib/ansible/executor/play_iterator.py
@@ -130,6 +130,8 @@ class PlayIterator:
                          break
                      else:
                          self.get_next_task_for_host(host)
+                 # finally, reset the host's state to ITERATING_SETUP
+                 self._host_states[host.name].run_state = self.ITERATING_SETUP
 
         # Extend the play handlers list to include the handlers defined in roles
         self._play.handlers.extend(play.compile_roles_handlers())