lookup('template') looks in files/ not templates/ ?

I see that lookup(‘template’) is looking in the files directory not the template directory.

`
fatal: [10.0.139.56] => Failed to template msg=“{{lookup(‘template’, ‘rs_initiate_cmd.js.j2’)}}”: unable to read /Users/bkaplan/si/ops/ansible/playbooks/roles/mongodb/files/rs_initiate_cmd.js.j2

`

Is this expected or a bug? I can’t find any docs on lookup(‘template’) only the example in the Lookups section. (Have not looked at the code yet.)

It is expected.

All lookups use files/, I agree this is confusing with template and
would contemplate adding the templates/ directories for this specific
plugin.