ansible-playbook silently fails when role is missing

13 views
Skip to first unread message

Giovanni Tirloni

unread,
Feb 13, 2017, 9:07:12 AM2/13/17
to Ansible Project
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

Brian Coca

unread,
Feb 13, 2017, 9:43:34 AM2/13/17
to Ansible Project
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:
- idontexist
^ here


when running this play:

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

----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages