@ -236,13 +236,16 @@ class TaskQueueManager:
start_at_done = self . _start_at_done ,
start_at_done = self . _start_at_done ,
)
)
# because the TQM may survive multiple play runs, we start by
# Because the TQM may survive multiple play runs, we start by marking
# marking any hosts as failed in the iterator here which may
# any hosts as failed in the iterator here which may have been marked
# have been marked as failed in previous runs.
# as failed in previous runs. Then we clear the internal list of failed
# hosts so we know what failed this round.
for host_name in self . _failed_hosts . keys ( ) :
for host_name in self . _failed_hosts . keys ( ) :
host = self . _inventory . get_host ( host_name )
host = self . _inventory . get_host ( host_name )
iterator . mark_host_failed ( host )
iterator . mark_host_failed ( host )
self . clear_failed_hosts ( )
# during initialization, the PlayContext will clear the start_at_task
# during initialization, the PlayContext will clear the start_at_task
# field to signal that a matching task was found, so check that here
# field to signal that a matching task was found, so check that here
# and remember it so we don't try to skip tasks on future plays
# and remember it so we don't try to skip tasks on future plays
@ -251,6 +254,11 @@ class TaskQueueManager:
# and run the play using the strategy and cleanup on way out
# and run the play using the strategy and cleanup on way out
play_return = strategy . run ( iterator , play_context )
play_return = strategy . run ( iterator , play_context )
# now re-save the hosts that failed from the iterator to our internal list
for host_name in iterator . get_failed_hosts ( ) :
self . _failed_hosts [ host_name ] = True
self . _cleanup_processes ( )
self . _cleanup_processes ( )
return play_return
return play_return