# lookup plugins and with\_

**URL:** <https://forum.ansible.com/t/lookup-plugins-and-with/12686>\
**Category:** Ansible Project\
**Created:** [April 16, 2013, 2:37pm UTC](https://forum.ansible.com/t/lookup-plugins-and-with/12686 "2013-04-16T14:37:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![C\_Morgan\_Hamill](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@C\_Morgan\_Hamill](https://forum.ansible.com/u/C_Morgan_Hamill)\
**Post date:** [April 16, 2013, 2:37pm UTC](https://forum.ansible.com/t/lookup-plugins-and-with/12686/1 "2013-04-16T14:37:56Z")

</div>

Noticed that lookup plugins currently don't work with the new-style  
variable interpolation syntax (jinja2-style) when used in the  
'with\_LOOKUP' form.

Are there any plans to allow that, or even to allow bare variable names  
as with the plain 'with\_items' form (which seems to work as of now)?

---

<div class="post-metadata">

**Author:** ![benno\_joy](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@benno\_joy](https://forum.ansible.com/u/benno_joy)\
**Post date:** [April 16, 2013, 2:56pm UTC](https://forum.ansible.com/t/lookup-plugins-and-with/12686/2 "2013-04-16T14:56:55Z")

</div>

This should work with the lastest devel branch {{ lookup(‘file’,‘/tmp/a’) }}

- Benno

---

<div class="post-metadata">

**Author:** ![C\_Morgan\_Hamill](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@C\_Morgan\_Hamill](https://forum.ansible.com/u/C_Morgan_Hamill)\
**Post date:** [April 16, 2013, 3:02pm UTC](https://forum.ansible.com/t/lookup-plugins-and-with/12686/3 "2013-04-16T15:02:33Z")

</div>

Excerpts from benno joy's message of 2013-04-16 10:56:55 -0400:

> This should work with the lastest devel branch {{ lookup('file','/tmp/a') }}

Correct, but:

vars:  
&nbsp;&nbsp;foo:  
&nbsp;&nbsp;&nbsp;&nbsp;- /etc/resolv.conf  
&nbsp;&nbsp;&nbsp;&nbsp;- /etc/hosts  
tasks:  
&nbsp;&nbsp;- debug: msg={{ item }}  
&nbsp;&nbsp;&nbsp;&nbsp;with\_file: foo

&nbsp;&nbsp;- debug: msg={{ item }}  
&nbsp;&nbsp;&nbsp;&nbsp;with\_file: "{{ foo }}"

Neither of those two tasks will work (the latter being the concern,  
really).

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [April 16, 2013, 4:05pm UTC](https://forum.ansible.com/t/lookup-plugins-and-with/12686/4 "2013-04-16T16:05:30Z")

</div>

Can you please file a issue on github?

---

<div class="post-metadata">

**Author:** ![C\_Morgan\_Hamill](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@C\_Morgan\_Hamill](https://forum.ansible.com/u/C_Morgan_Hamill)\
**Post date:** [April 16, 2013, 5:34pm UTC](https://forum.ansible.com/t/lookup-plugins-and-with/12686/5 "2013-04-16T17:34:40Z")

</div>

Excerpts from Michael DeHaan's message of 2013-04-16 12:05:30 -0400:

> Can you please file a issue on github?

\<[https://github.com/ansible/ansible/issues/2696&gt](https://github.com/ansible/ansible/issues/2696&gt);

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [April 16, 2013, 5:38pm UTC](https://forum.ansible.com/t/lookup-plugins-and-with/12686/6 "2013-04-16T17:38:53Z")

</div>

Thanks, commented a bit.

with\_items and with\_nested should already be good, but we’ll do something more generic so we can reference them everywhere.
