问题
According to saltstack documentation it's "json": https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html
But in jinja doc http://jinja.pocoo.org/docs/2.9/templates/#builtin-filters - there is not "json", but "tojson".
Does anybody know why?
回答1:
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.
来源:https://stackoverflow.com/questions/44299336/is-there-any-difference-between-json-and-tojson-filters-in-jinja-for-saltsta