Smart file paths in lookup plugins.

Howdy (again),

It seems like it would be nice if things like:

    {{ lookup('file', 'foo.txt') }}

looked for 'foo.txt' in roles/curr_role/files/ before falling back to
looking in 'basedir'.

I'd be happy to write a patch to do so, but it doesn't seem like there's
a simple way to get the name of the role from any of the places where
the calls to run the plugin are made.

Is there any simple way of passing the role name (or the role's
directory) to a lookup plugin at run time?

It would be better if it just worked automagically in both basedirs.

Not sure what that takes presently, please make sure there is a github ticket.

Excerpts from Michael DeHaan's message of 2013-04-16 14:40:58 -0400:

It would be better if it just worked automagically in both basedirs.

Not sure what that takes presently, please make sure there is a github
ticket.

There you go.
<https://github.com/ansible/ansible/issues/2697&gt;