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

38 views
Skip to first unread message

Warren Seine

unread,
Mar 26, 2015, 5:50:10 AM3/26/15
to ansible...@googlegroups.com
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.

Matt Martz

unread,
Mar 26, 2015, 7:28:22 AM3/26/15
to ansible...@googlegroups.com
I would saying forking the YAML module is an absolutely terrible idea.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/559ef628-7092-4d35-ae1f-7916a5f8d275%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Warren Seine

unread,
Mar 26, 2015, 9:35:15 AM3/26/15
to ansible...@googlegroups.com
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?

On Thursday, March 26, 2015 at 12:28:22 PM UTC+1, Matt Martz wrote:
I would saying forking the YAML module is an absolutely terrible idea.

On Thursday, March 26, 2015, Warren Seine <warren...@aerys.in> wrote:
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.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.

Matt Martz

unread,
Mar 26, 2015, 9:44:55 AM3/26/15
to ansible...@googlegroups.com
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.

To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8f8f1882-4c7d-43be-ae8c-06b823e2e3ed%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages