# ansible-playbook silently fails when role is missing

**URL:** <https://forum.ansible.com/t/ansible-playbook-silently-fails-when-role-is-missing/23708>\
**Category:** Ansible Project\
**Created:** [February 11, 2017, 2:48pm UTC](https://forum.ansible.com/t/ansible-playbook-silently-fails-when-role-is-missing/23708 "2017-02-11T14:48:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_Tirloni](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Giovanni\_Tirloni](https://forum.ansible.com/u/Giovanni_Tirloni)\
**Post date:** [February 11, 2017, 2:48pm UTC](https://forum.ansible.com/t/ansible-playbook-silently-fails-when-role-is-missing/23708/1 "2017-02-11T14:48:41Z")

</div>

Hello,

When running a playbook that includes a role that is missing from the roles directory, Ansible runs the playbook without complaining (except the tasks from the missing role are not included, obviously).

Would it be possible to make ansible-playbook complain that we’re including a role that cannot be used? That would help in certain situations where using git submodules and the repository might not have been properly initialized. As it is now, the playbook runs fine and no errors are reported.

Thank you,  
Giovanni

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 13, 2017, 2:43pm UTC](https://forum.ansible.com/t/ansible-playbook-silently-fails-when-role-is-missing/23708/2 "2017-02-13T14:43:28Z")

</div>

What you describe is a bug, but I've tested a few versions and I get  
this when I try using a non existent role:

ERROR! the role 'idontexist' was not found in /...

The error appears to have been in '/.../play.yml': line 7, column 7, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

roles:  
&nbsp;&nbsp;&nbsp;- idontexist  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^ here

when running this play:

- hosts: localhost  
&nbsp;&nbsp;roles:  
&nbsp;&nbsp;&nbsp;&nbsp;- idontexist  
&nbsp;&nbsp;tasks:  
&nbsp;&nbsp;&nbsp;&nbsp;- debug: msg='if i get here, its a bug'
