# Possible 2.3 regression using any\_errors\_fatal and tasks under roles

**URL:** <https://forum.ansible.com/t/possible-2-3-regression-using-any-errors-fatal-and-tasks-under-roles/24454>\
**Category:** Ansible Developer\
**Created:** [May 10, 2017, 8:13pm UTC](https://forum.ansible.com/t/possible-2-3-regression-using-any-errors-fatal-and-tasks-under-roles/24454 "2017-05-10T20:13:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed1](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@Ed1](https://forum.ansible.com/u/Ed1)\
**Post date:** [May 10, 2017, 8:13pm UTC](https://forum.ansible.com/t/possible-2-3-regression-using-any-errors-fatal-and-tasks-under-roles/24454/1 "2017-05-10T20:13:33Z")

</div>

In 2.3, there’s a possible regression with any\_errors\_fatal and tasks in roles. [https://github.com/ansible/ansible/issues/14100](https://github.com/ansible/ansible/issues/14100) says to bring the question to the list, so here I am.

In 2.3:

> $ ansible-playbook -i inventory play.yml
> 
> PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> ok: [two]  
> ok: [one]
> 
> TASK [testrole : fail] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> ok: [two]  
> fatal: [one]: FAILED! =\> {“changed”: false, “failed”: true, “failed\_when\_result”: true, “msg”: “Failed as requested from task”}
> 
> TASK [testrole : should not be reached] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> ok: [two] =\> {  
> “changed”: false,  
> “msg”: “Yet here I am”  
> }  
> to retry, use: --limit @/home/centos/play.retry
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> one : ok=1 changed=0 unreachable=0 failed=1  
> two : ok=3 changed=0 unreachable=0 failed=0
> 
> ## $ cat inventory one ansible\_connection=local two ansible\_connection=local $ cat play.yml
> 
> - hosts: all  
> any\_errors\_fatal: true  
> roles:
> - testrole  
> $ cat roles/testrole/tasks/main.yml
> 
> * * *
> 
> - fail:  
> failed\_when: inventory\_hostname == ‘one’
> 
> - name: should not be reached  
> debug:  
> msg: Yet here I am  
> $

In 2.2:

> $ ansible-playbook -i inventory play.yml
> 
> PLAY [all] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> ok: [one]  
> ok: [two]
> 
> TASK [testrole : fail] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> fatal: [one]: FAILED! =\> {“changed”: false, “failed”: true, “failed\_when\_result”: true, “msg”: “Failed as requested from task”}  
> ok: [two]
> 
> NO MORE HOSTS LEFT \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> to retry, use: --limit @/home/centos/play.retry
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> one : ok=1 changed=0 unreachable=0 failed=1  
> two : ok=2 changed=0 unreachable=0 failed=0
> 
> $

Thanks,  
Ed

---

<div class="post-metadata">

**Author:** ![james3](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@james3](https://forum.ansible.com/u/james3)\
**Post date:** [May 10, 2017, 10:34pm UTC](https://forum.ansible.com/t/possible-2-3-regression-using-any-errors-fatal-and-tasks-under-roles/24454/2 "2017-05-10T22:34:48Z")

</div>

Yes, we had to add it to all the tasks instead.
