compare the number of available hosts before and after running each task

This commit is contained in:
Junegunn Choi 2013-03-29 13:13:22 +09:00
parent 20a48c6bdf
commit b874027b36

View file

@ -449,6 +449,7 @@ class PlayBook(object):
self.inventory.also_restrict_to(on_hosts) self.inventory.also_restrict_to(on_hosts)
for task in play.tasks(): for task in play.tasks():
hosts_count = len(self._list_available_hosts(play.hosts))
# only run the task if the requested tags match # only run the task if the requested tags match
should_run = False should_run = False
@ -466,7 +467,7 @@ class PlayBook(object):
host_list = self._list_available_hosts(play.hosts) host_list = self._list_available_hosts(play.hosts)
if task.any_errors_fatal and len(self.stats.failures) > 0: if task.any_errors_fatal and len(host_list) < hosts_count:
host_list = None host_list = None
# if no hosts remain, drop out # if no hosts remain, drop out