Fixes premature handler execution after adding force-handlers
This commit is contained in:
parent
d545b73ccb
commit
605156c904
1 changed files with 10 additions and 7 deletions
|
@ -601,6 +601,7 @@ class PlayBook(object):
|
||||||
play_hosts.append(all_hosts.pop())
|
play_hosts.append(all_hosts.pop())
|
||||||
serialized_batch.append(play_hosts)
|
serialized_batch.append(play_hosts)
|
||||||
|
|
||||||
|
task_errors = False
|
||||||
for on_hosts in serialized_batch:
|
for on_hosts in serialized_batch:
|
||||||
|
|
||||||
# restrict the play to just the hosts we have in our on_hosts block that are
|
# restrict the play to just the hosts we have in our on_hosts block that are
|
||||||
|
@ -657,16 +658,18 @@ class PlayBook(object):
|
||||||
# if no hosts remain, drop out
|
# if no hosts remain, drop out
|
||||||
if not host_list:
|
if not host_list:
|
||||||
if self.force_handlers:
|
if self.force_handlers:
|
||||||
if not self.run_handlers(play):
|
task_errors == True
|
||||||
return False
|
break
|
||||||
else:
|
else:
|
||||||
self.callbacks.on_no_hosts_remaining()
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
self.inventory.lift_also_restriction()
|
|
||||||
if not self.run_handlers(play):
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if task_errors and not self.force_handlers:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
self.inventory.lift_also_restriction()
|
||||||
|
if not self.run_handlers(play):
|
||||||
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue