Is there any difference between "json" and "tojson" filters in jinja for saltstack?
While I can't say absolutely for sure, I have an impression that Salt Renderers are built-in for Salt only. For example, there are also yaml
and python
renderers, but there is no corresponding filter for Jinja.
So, json
renderer and tojson
filter just happened to have similar names because of their purpose. And you won't be able to use json
renderer outside of Salt.
I am not 100% sure, but I see tojson
renders <script>
tag as string if present in json. The json
does not and executes the js.