Clear failed state in always only if we did rescue (#52829)

Fixes #52561
This commit is contained in:
Martin Krizek 2019-02-25 09:30:17 +01:00 committed by GitHub
parent a1ec307d43
commit f135960fc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Fix handlers on failed hosts with always section (https://github.com/ansible/ansible/issues/52561)

View file

@ -484,7 +484,7 @@ 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:
elif state.run_state == self.ITERATING_ALWAYS and state.fail_state & self.FAILED_ALWAYS == 0 and state.did_rescue:
return False
else:
return not state.did_rescue