template module setting variables to unicode

Hi,

I’ve recently updated from 1.9.1 to 2.0.2.0. I use the template module a lot to build configs for my app. After updating, when I generate my templates, the data structure variables are being rendered as unicode strings.

Versions:

ansible 2.0.2.0PyYAML==3.11
Jinja2==2.8

Example:
File with variables:

`

This is a ‘pythonism’, in 2.0 we are much better about handling unicode, a consequence of that is that the structures that were possibly ASCII internally are now all unicode, which python represents as u’'.

If you want a YAML or JSON output (without u’ ') you should use |to_yaml or |to_json filters.

That works. Thank you!