Skip to content

Instantly share code, notes, and snippets.

@vmlinz
Created July 21, 2015 14:20
Show Gist options
  • Save vmlinz/cf61feb0d9cbdf6f7b29 to your computer and use it in GitHub Desktop.
Save vmlinz/cf61feb0d9cbdf6f7b29 to your computer and use it in GitHub Desktop.
render jinja variable to json string without unicode prefix
# Issue #
When I want to print jinja variable to a json, the default filter will add a 'u' prefix to indicate the string encoding, but the configuration file sees this as syntax error.
## Resources
* https://stackoverflow.com/questions/8710758/json-is-appearing-as-unicode-entities-in-jinja2-template
* https://docs.ansible.com/ansible/playbooks_filters.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment