ansible/ansible — pull request #3773 by cchurch (2013-08-06 17:00:42+00:00)
Title: Update callbacks used for async tasks

(In lib/ansible/runner/poller.py) It's possible to have an async task fail with rc != 0, call the runner_on_failed callback, then followed by a runner_on_async_ok callback. Correctly check for failed status from an async task so that the runner_on_async_failed callback is used whenever the task fails.

(In lib/ansible/playbook/__init__.py) A task that times out calls the runner_on_failed callback. I think it makes more sense to use the runner_on_async_failed callback instead.

(In lib/ansible/playbook/__init__.py) When an async task is started in fire and forget mode, the only callback called is runner_on_ok (from launching the task via async_wrapper), and no runner_on_async_* callbacks are called. I'm proposing adding a call to the runner_on_async_ok callback in this case, so that every async task will result in at least one runner_on_async_* callback.