|
|
|
@ -244,7 +244,7 @@ class PlayIterator:
|
|
|
|
|
display.debug("host %s is done iterating, returning" % host.name)
|
|
|
|
|
return (s, None)
|
|
|
|
|
|
|
|
|
|
(s, task) = self._get_next_task_from_state(s, host=host, peek=peek)
|
|
|
|
|
(s, task) = self._get_next_task_from_state(s, host=host)
|
|
|
|
|
|
|
|
|
|
if not peek:
|
|
|
|
|
self._host_states[host.name] = s
|
|
|
|
@ -254,7 +254,7 @@ class PlayIterator:
|
|
|
|
|
display.debug(" ^ state is: %s" % s)
|
|
|
|
|
return (s, task)
|
|
|
|
|
|
|
|
|
|
def _get_next_task_from_state(self, state, host, peek, in_child=False):
|
|
|
|
|
def _get_next_task_from_state(self, state, host):
|
|
|
|
|
|
|
|
|
|
task = None
|
|
|
|
|
|
|
|
|
@ -318,7 +318,7 @@ class PlayIterator:
|
|
|
|
|
# have one recurse into it for the next task. If we're done with the child
|
|
|
|
|
# state, we clear it and drop back to getting the next task from the list.
|
|
|
|
|
if state.tasks_child_state:
|
|
|
|
|
(state.tasks_child_state, task) = self._get_next_task_from_state(state.tasks_child_state, host=host, peek=peek, in_child=True)
|
|
|
|
|
(state.tasks_child_state, task) = self._get_next_task_from_state(state.tasks_child_state, host=host)
|
|
|
|
|
if self._check_failed_state(state.tasks_child_state):
|
|
|
|
|
# failed child state, so clear it and move into the rescue portion
|
|
|
|
|
state.tasks_child_state = None
|
|
|
|
@ -359,7 +359,7 @@ class PlayIterator:
|
|
|
|
|
self._play._removed_hosts.remove(host.name)
|
|
|
|
|
|
|
|
|
|
if state.rescue_child_state:
|
|
|
|
|
(state.rescue_child_state, task) = self._get_next_task_from_state(state.rescue_child_state, host=host, peek=peek, in_child=True)
|
|
|
|
|
(state.rescue_child_state, task) = self._get_next_task_from_state(state.rescue_child_state, host=host)
|
|
|
|
|
if self._check_failed_state(state.rescue_child_state):
|
|
|
|
|
state.rescue_child_state = None
|
|
|
|
|
self._set_failed_state(state)
|
|
|
|
@ -389,7 +389,7 @@ class PlayIterator:
|
|
|
|
|
# run state to ITERATING_COMPLETE in the event of any errors, or when we
|
|
|
|
|
# have hit the end of the list of blocks.
|
|
|
|
|
if state.always_child_state:
|
|
|
|
|
(state.always_child_state, task) = self._get_next_task_from_state(state.always_child_state, host=host, peek=peek, in_child=True)
|
|
|
|
|
(state.always_child_state, task) = self._get_next_task_from_state(state.always_child_state, host=host)
|
|
|
|
|
if self._check_failed_state(state.always_child_state):
|
|
|
|
|
state.always_child_state = None
|
|
|
|
|
self._set_failed_state(state)
|
|
|
|
@ -411,11 +411,6 @@ class PlayIterator:
|
|
|
|
|
state.rescue_child_state = None
|
|
|
|
|
state.always_child_state = None
|
|
|
|
|
state.did_rescue = False
|
|
|
|
|
|
|
|
|
|
# we're advancing blocks, so if this was an end-of-role block we
|
|
|
|
|
# mark the current role complete
|
|
|
|
|
if block._eor and host.name in block._role._had_task_run and not in_child and not peek:
|
|
|
|
|
block._role._completed[host.name] = True
|
|
|
|
|
else:
|
|
|
|
|
task = block.always[state.cur_always_task]
|
|
|
|
|
if isinstance(task, Block):
|
|
|
|
|