# Help needed: Please explain basic concept about variables syntax.

**URL:** <https://forum.ansible.com/t/help-needed-please-explain-basic-concept-about-variables-syntax/13962>\
**Category:** Ansible Project\
**Created:** [November 21, 2013, 9:54pm UTC](https://forum.ansible.com/t/help-needed-please-explain-basic-concept-about-variables-syntax/13962 "2013-11-21T21:54:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frederic\_Roland](https://avatars.discourse-cdn.com/v4/letter/f/f08c70/32.png) [@Frederic\_Roland](https://forum.ansible.com/u/Frederic_Roland)\
**Post date:** [November 21, 2013, 9:54pm UTC](https://forum.ansible.com/t/help-needed-please-explain-basic-concept-about-variables-syntax/13962/1 "2013-11-21T21:54:12Z")

</div>

Hi,  
I’m new to using ansible and I’ve seen several way to use/reference/define variables and I’m not sure when to use these notations.

I’ve seen variables such as:

$variable\_name  
${variable\_name}  
{{ variable\_name }}

This is very confusing for a first time user and I haven’t found why/when using these various syntaxes.

Could you please explain me ?

Best regards,  
F.R.

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [November 21, 2013, 10:25pm UTC](https://forum.ansible.com/t/help-needed-please-explain-basic-concept-about-variables-syntax/13962/2 "2013-11-21T22:25:57Z")

</div>

​It is really easy:​

​Never, ever use these two syntaxes:

$variable\_name

> ${variable\_name}

They are old, deprecated, and not supported!

Only use this one:  
​​

> {{ variable\_name }}

​See also  
[http://www.ansibleworks.com/docs/playbooks\_variables.html#using-variables-about-jinja2](http://www.ansibleworks.com/docs/playbooks_variables.html#using-variables-about-jinja2)

You'll notice that only the one true syntax is mentioned :)​

Serge

---

<div class="post-metadata">

**Author:** ![Frederic\_Roland](https://avatars.discourse-cdn.com/v4/letter/f/f08c70/32.png) [@Frederic\_Roland](https://forum.ansible.com/u/Frederic_Roland)\
**Post date:** [November 21, 2013, 10:30pm UTC](https://forum.ansible.com/t/help-needed-please-explain-basic-concept-about-variables-syntax/13962/3 "2013-11-21T22:30:57Z")

</div>

Hi Serge,

thank you very much.

In fact I’ve seen jinja2 mentionned on the website but when I find sample playbook on the web with explanations they are using old syntax.  
I’ll convert them.

F.R.

---

<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:** [November 21, 2013, 11:46pm UTC](https://forum.ansible.com/t/help-needed-please-explain-basic-concept-about-variables-syntax/13962/4 "2013-11-21T23:46:54Z")

</div>

Yeah I unfortunately can’t do anything about old blog posts.

For Ansible 1.4, it will warn you about deprecation issues, so I think this question will quickly self-resolve as more people adopt 1.4.
