Salt Jinja Syntax error: no filter named 'yaml_encode'

Salt Jinja Syntax error: no filter named 'yaml_encode'

当 运行 salt '*' state.highstate 时,我的 SLS 文件无法呈现并显示以下消息:

    Data failed to compile:
----------
    Rendering SLS 'base:files' failed: Jinja syntax error: no filter named 'yaml_encode'; line 6

---
{% for folder, options in salt['pillar.get']('dirs', {}).items() %}
{{ folder }}:
{%- load_yaml as foo %}
  file.directory:
    {% for key, val in options.items() %}
    - {{ key }}: {{ val|yaml_encode }}    <======================
    {% endfor %}
    - order: 1
{%- endload %}
{% endfor %}
---

The docs 表明这个过滤器只是在任何你想转义 YAML 的地方使用,所以我不知道为什么没有定义过滤器。

所有 minions 和 master 都是 运行 Ubuntu 服务器 14.04,以及来自 Launchpad PPA

的 Salt 2014.7.1

虽然过滤器已记录在案,但它具有误导性,因为文档是从当前的开发分支生成的,而不是最新的稳定分支。

The docs for older versions are available from readthedocs.org.

The pull request that introduced this feature 尚未 "merged back" 进入 2014.7。