ansible/ansible — pull request #9770 by tpo (2014-12-10 18:16:44+00:00)
Title: make error message easier to understand and to act upon

Issue Type:
Feature Pull Request
Ansible Version:
ansible 1.7.2
Environment:
N/A
Summary:
make error message more helpful and clear
Steps To Reproduce:
just use a role inside a playbook that isn't defined yet or has a different or a wrong name
Expected Results:
I'd like to tell me what role ansible was looking for and didn't find. An error message like this what I'd like to see:

ERROR: cannot find role 'postgres' in /home/user/src/clients/company/ansible/hosts/machine/roles/postgres or /home/user/src/clients/company/ansible/hosts/machine/postgres or /home/user/src/clients/company/ansible/roles/postgres

Actual Results:
The actual error message I am getting from ansible is:

ERROR: cannot find role in /home/user/src/clients/company/ansible/hosts/machine/roles/postgres or /home/user/src/clients/company/ansible/hosts/machine/postgres or /home/user/src/clients/company/ansible/roles/postgres

If you are used to seeing this kind of error message, you'll quickly know what's wrong. However as an uninitiated you'll wonder. Therefore I propose to explicitly name the role ansible is looking for.

Thanks