diff options
author | James Cammarata <jimi@sngx.net> | 2016-09-20 11:10:27 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2016-09-20 11:11:52 -0500 |
commit | 4dc2bf4815c4c16f131b7b4a6ae36d55b589b586 (patch) | |
tree | 665d9bb7ad938677559af67731ddea1c15236dad | |
parent | 1975a545bda3b32cb47ea30140f99c54cc354ad2 (diff) | |
download | ansible-4dc2bf4815c4c16f131b7b4a6ae36d55b589b586.tar.gz |
Take ITERATING_ALWAYS into account when setting failed state in PlayIteratorissue_15963_include_blocks_bug
Fixes #15963
-rw-r--r-- | lib/ansible/executor/play_iterator.py | 2 | ||||
-rw-r--r-- | lib/ansible/plugins/strategy/linear.py | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/ansible/executor/play_iterator.py b/lib/ansible/executor/play_iterator.py index a8c00833e7..b2b30520dc 100644 --- a/lib/ansible/executor/play_iterator.py +++ b/lib/ansible/executor/play_iterator.py @@ -502,6 +502,8 @@ class PlayIterator: elif state.fail_state != self.FAILED_NONE: if state.run_state == self.ITERATING_RESCUE and state.fail_state&self.FAILED_RESCUE == 0: return False + elif state.run_state == self.ITERATING_ALWAYS and state.fail_state&self.FAILED_ALWAYS == 0: + return False else: return True elif state.run_state == self.ITERATING_TASKS and self._check_failed_state(state.tasks_child_state): diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index e639c9bdfb..3acd58832c 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -70,9 +70,12 @@ class StrategyModule(StrategyBase): if state_task and state_task[1]] if host_tasks_to_run: - lowest_cur_block = min( - (s.cur_block for h, (s, t) in host_tasks_to_run - if s.run_state != PlayIterator.ITERATING_COMPLETE)) + try: + lowest_cur_block = min( + (s.cur_block for h, (s, t) in host_tasks_to_run + if s.run_state != PlayIterator.ITERATING_COMPLETE)) + except ValueError: + lowest_cur_block = None else: # empty host_tasks_to_run will just run till the end of the function # without ever touching lowest_cur_block |