# Ansible parse variables with special characters

**URL:** <https://forum.ansible.com/t/ansible-parse-variables-with-special-characters/29549>\
**Category:** Ansible Project\
**Created:** [January 28, 2019, 5:31pm UTC](https://forum.ansible.com/t/ansible-parse-variables-with-special-characters/29549 "2019-01-28T17:31:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pnagaraj7656](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pnagaraj7656](https://forum.ansible.com/u/pnagaraj7656)\
**Post date:** [January 28, 2019, 5:31pm UTC](https://forum.ansible.com/t/ansible-parse-variables-with-special-characters/29549/1 "2019-01-28T17:31:03Z")

</div>

I need to pass certain strings with special characters like $ to variables.  
I was able to parse by providing the values in single quotes or using \ when the string contains a single $ .

Ex below x is my variable.

X : '${name}' --\> this works.

But when my variable value is complex containing many $ in its value, it doesn't parse it.

Example :  
X : '${name} --loglevel = ${loglevel}, --type=${type}'

The above is a shortend version but actually has many $ in the same format like above.  
I tried using \ for every $ but it didn't help.

Is there a way to parse them ?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 28, 2019, 5:48pm UTC](https://forum.ansible.com/t/ansible-parse-variables-with-special-characters/29549/2 "2019-01-28T17:48:04Z")

</div>

I got no problem with this so I think you need to explain more in detail what you are doing.

$ cat test.yml

---

<div class="post-metadata">

**Author:** ![eric.dunn](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@eric.dunn](https://forum.ansible.com/u/eric.dunn)\
**Post date:** [January 28, 2019, 9:48pm UTC](https://forum.ansible.com/t/ansible-parse-variables-with-special-characters/29549/3 "2019-01-28T21:48:16Z")

</div>

I had ame issue.  
Try escaping dollar sign

X : ‘${name} --loglevel = ${loglevel}, --type=${type}’
