# Here's how to accessing 'lookup plugins' from new-style 1.2 variable syntax

**URL:** <https://forum.ansible.com/t/heres-how-to-accessing-lookup-plugins-from-new-style-1-2-variable-syntax/12667>\
**Category:** Ansible Project\
**Created:** [April 11, 2013, 6:13pm UTC](https://forum.ansible.com/t/heres-how-to-accessing-lookup-plugins-from-new-style-1-2-variable-syntax/12667 "2013-04-11T18:13:16Z")\
**Posts on this page:** 3\
**Page:** 1

<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 11, 2013, 6:13pm UTC](https://forum.ansible.com/t/heres-how-to-accessing-lookup-plugins-from-new-style-1-2-variable-syntax/12667/1 "2013-04-11T18:13:16Z")

</div>

Before, looked a little bit like Perl to me:

before:

$ENV(HOME)

using Jinja2 function:

{{ lookup(‘env’,‘home’) }}

I can probabably extend things such that the following is possible, but it presently is not:

{{ env(‘home’) }}

---

<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 12, 2013, 8:51pm UTC](https://forum.ansible.com/t/heres-how-to-accessing-lookup-plugins-from-new-style-1-2-variable-syntax/12667/2 "2013-04-12T20:51:39Z")

</div>

Excerpts from Michael DeHaan's message of 2013-04-11 14:13:16 -0400:

> Before, looked a little bit like Perl to me:
> 
> before:
> 
> $ENV(HOME)
> 
> using Jinja2 function:
> 
> {{ lookup('env','home') }}
> 
> I can probabably extend things such that the following is possible, but it  
> presently is not:
> 
> {{ env('home') }}

Can this syntax be used in jinja2 templates to access lookup plugins?

---

<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 13, 2013, 12:12am UTC](https://forum.ansible.com/t/heres-how-to-accessing-lookup-plugins-from-new-style-1-2-variable-syntax/12667/3 "2013-04-13T00:12:28Z")

</div>

The lookup() function should be available to both.

I still need to work to make the proposed syntactic sugar (env, file, etc) available.
