ansible/ansible — pull request #8410 by anoutsider (2014-08-02 21:38:58+00:00)
Title: fail module: Add an "all" argument to trigger a fatal error

Adds an optional "all" parameter to the "fail" module, which modifies it's behavior to trigger a fatal error for the whole playbook.

this was implemented without raising an ansible error, we only set the remaining_hosts to False and stop the rest of the task execution, and it's triggered by passing a "Fatal" keyword in the module return data.

This PR originated here : https://groups.google.com/forum/#!topic/ansible-project/gDzrZVQ3AMw

An integration test is includes under test/integration/test_fail.yml

```
---
- hosts: local
vars:
fail_run: "YES"

tasks:
- name: test fail with all
fail: msg="Failed" all=yes
when: fail_run == "YES"
tags: ["fail_with_all"]

- name: test fail with all
debug: msg="Dummy run"
tags: ["fail_with_all"]

- name: test fail without all
debug: msg="Dummy run"
tags: ["fail_without_all"]

- name: test fail without all
fail: msg="Failed"
when: fail_run == "YES"
tags: ["fail_without_all"]

- name:
debug: msg="Still running"
tags: ["fail_with_all", "fail_without_all"]
```