# Extending YAML to support {{ at the beginning of a value

**URL:** <https://forum.ansible.com/t/extending-yaml-to-support-at-the-beginning-of-a-value/17845>\
**Category:** Ansible Project\
**Created:** [March 26, 2015, 9:50am UTC](https://forum.ansible.com/t/extending-yaml-to-support-at-the-beginning-of-a-value/17845 "2015-03-26T09:50:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warren\_Seine](https://avatars.discourse-cdn.com/v4/letter/w/ac8455/32.png) [@Warren\_Seine](https://forum.ansible.com/u/Warren_Seine)\
**Post date:** [March 26, 2015, 9:50am UTC](https://forum.ansible.com/t/extending-yaml-to-support-at-the-beginning-of-a-value/17845/1 "2015-03-26T09:50:10Z")

</div>

Hi,

Ansible handles pretty well the incompatibility between YAML and Jinja templates with a nice, informative, explicit error message. I suppose this is so because writing foo: {{ bar }} is an extremely common pattern and most users face the error. The workaround is simple but still, annoying.

Was there any thoughts about forking the YAML parser to extend the syntax? This kind of syntax extension is not really grammar-breaking and would be a nice improvement in playbooks.

Regards,  
Warren.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [March 26, 2015, 11:28am UTC](https://forum.ansible.com/t/extending-yaml-to-support-at-the-beginning-of-a-value/17845/2 "2015-03-26T11:28:15Z")

</div>

I would saying forking the YAML module is an absolutely terrible idea.

---

<div class="post-metadata">

**Author:** ![Warren\_Seine](https://avatars.discourse-cdn.com/v4/letter/w/ac8455/32.png) [@Warren\_Seine](https://forum.ansible.com/u/Warren_Seine)\
**Post date:** [March 26, 2015, 1:35pm UTC](https://forum.ansible.com/t/extending-yaml-to-support-at-the-beginning-of-a-value/17845/3 "2015-03-26T13:35:15Z")

</div>

I agree that forking is not a very good option for such a little addition, though the YAML Python library hasn’t been updated for 6 years, so there’s no risk missing a big upstream update anyway.

On the other hand, your answer is not really helpful here. What would be the optimal solution to avoid this issue? Should we not care?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [March 26, 2015, 1:44pm UTC](https://forum.ansible.com/t/extending-yaml-to-support-at-the-beginning-of-a-value/17845/4 "2015-03-26T13:44:09Z")

</div>

I guess there is a possibility that we create our own loader/scanner/parser. But in the end, I don’t really care, I don’t find it hard to remember to wrap ninja statements in quotes.

On another note, this is more suited for ansible-devel and not ansible-project.
