# syntax error in vars bubstution \[ shell module \]

**URL:** <https://forum.ansible.com/t/syntax-error-in-vars-bubstution-shell-module/16474>\
**Category:** Ansible Project\
**Created:** [October 8, 2014, 7:41pm UTC](https://forum.ansible.com/t/syntax-error-in-vars-bubstution-shell-module/16474 "2014-10-08T19:41:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subramanian\_Olagappa](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Subramanian\_Olagappa](https://forum.ansible.com/u/Subramanian_Olagappa)\
**Post date:** [October 8, 2014, 7:41pm UTC](https://forum.ansible.com/t/syntax-error-in-vars-bubstution-shell-module/16474/1 "2014-10-08T19:41:46Z")

</div>

Hi,

---

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [October 8, 2014, 8:03pm UTC](https://forum.ansible.com/t/syntax-error-in-vars-bubstution-shell-module/16474/2 "2014-10-08T20:03:12Z")

</div>

Try quoting the templated part. The {{ }} syntax markers mess up the  
yaml parsing - [http://docs.ansible.com/YAMLSyntax.html#gotchas](http://docs.ansible.com/YAMLSyntax.html#gotchas)

---

<div class="post-metadata">

**Author:** ![Subramanian\_Olagappa](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Subramanian\_Olagappa](https://forum.ansible.com/u/Subramanian_Olagappa)\
**Post date:** [October 10, 2014, 9:24am UTC](https://forum.ansible.com/t/syntax-error-in-vars-bubstution-shell-module/16474/3 "2014-10-10T09:24:24Z")

</div>

Hi Michael,

Quoting also did not work. I added “sh” before the {{ and it worked.

tasks:

- name: stop tomcat  
shell: sh {{ tomcat\_home }}/bin/shutdown.sh
- name: start tomcat  
shell: sh {{ tomcat\_home }}/bin/startup.sh

Thanks for the link.

Regards,  
Olga

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 13, 2014, 8:50pm UTC](https://forum.ansible.com/t/syntax-error-in-vars-bubstution-shell-module/16474/4 "2014-10-13T20:50:14Z")

</div>

“Quoting also did not work. I added “sh” before the {{ and it worked.”

Please show me what you tried and what the output was?

Thanks!

---

<div class="post-metadata">

**Author:** ![Subramanian\_Olagappa](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@Subramanian\_Olagappa](https://forum.ansible.com/u/Subramanian_Olagappa)\
**Post date:** [October 15, 2014, 4:20pm UTC](https://forum.ansible.com/t/syntax-error-in-vars-bubstution-shell-module/16474/5 "2014-10-15T16:20:50Z")

</div>

Hi Michael,

---

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [October 15, 2014, 4:25pm UTC](https://forum.ansible.com/t/syntax-error-in-vars-bubstution-shell-module/16474/6 "2014-10-15T16:25:08Z")

</div>

You need to quote the whole line, not just the templated part:
