Always force handler execution

When a task fails in a playbook, the default behaviour results
in notified handlers not running. This can result in a
configuration change being executed, but the service not being
restarted.

This patch changes the default behaviour to force the handlers
to run when a playbook fails for any reason except a host being
unreachable.

Change-Id: I8a16bb1a5c04345e962ab01225f3d972781d9ed7
Reference: http://docs.ansible.com/ansible/playbooks_error_handling.html#handlers-and-failure
This commit is contained in:
Jesse Pretorius 2016-10-01 14:02:36 +01:00 committed by Jesse Pretorius (odyssey4me)
parent cd48460572
commit 227f24f07e
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,8 @@
---
fixes:
- When a task fails while executing a playbook, the default behaviour for
Ansible is to fail for that host without executing any notifiers. This can
result in configuration changes being executed, but services not being
restarted. OpenStack-Ansible now sets ``ANSIBLE_FORCE_HANDLERS`` to
``True`` by default to ensure that all notified handlers attempt to
execute before stopping the playbook execution.

View File

@ -47,3 +47,5 @@ export ANSIBLE_SSH_PIPELINING="${ANSIBLE_SSH_PIPELINING:-True}"
export ANSIBLE_STRATEGY_PLUGINS="${ANSIBLE_STRATEGY_PLUGINS:-/etc/ansible/roles/plugins/strategy}"
export ANSIBLE_CONNECTION_PLUGINS="${ANSIBLE_CONNECTION_PLUGINS:-/etc/ansible/roles/plugins/connection}"
export ANSIBLE_FORCE_HANDLERS="${ANSIBLE_FORCE_HANDLERS:-True}"