Hi all,
I’ve just started experimenting with roles and noticed that play.py looks for the role in the current playbook’s directory first as opposed to under ./roles/ (e.g. looks for ./myrole/tasks/main.yml first before ./roles/myrole/tasks/main.yml). If it finds the ./myrole directory it assumes that’s the role directory and proceeds accordingly. Obviously having myrole in both places is confusing and I shouldn’t do that (this was just a result of me starting to move things from a non-role-based setup to a role-based one), but the order of search for roles feels backwards to me based on the recommendations at http://ansible.cc/docs/bestpractices.html. Would a patch be accepted to first look for a role’s yml files in roles/ and then try the local directory if it’s not found there?
This may also be helpful in explaining what I mean: http://pastebin.com/v5H9CTFF
Another patch I was considering is throwing an error if none of tasks/main.yml,vars/main.yml, OR handlers/main.yml exist under the role dir since that almost certainly implies a mistake in configuration… that would have saved me a bunch of time trying to figure out why my role wasn’t running any tasks (showing me that it was looking in ./myrole instead of roles/myrole).
thanks!
matt