瀏覽代碼

Handle pillar params with child params. (#372)

tags/v0.57.0
Matthew Richardson 6 年之前
父節點
當前提交
1a5027ef8c
共有 2 個文件被更改,包括 22 次插入0 次删除
  1. +11
    -0
      salt/files/master.d/f_defaults.conf
  2. +11
    -0
      salt/files/minion.d/f_defaults.conf

+ 11
- 0
salt/files/master.d/f_defaults.conf 查看文件

@@ -1168,7 +1168,18 @@ ext_pillar:
{%- elif pillar[key] is iterable and 'dict' not in pillar[key].__class__.__name__ %}
- {{ key }}:
{%- for parameter in pillar[key] %}
{%- if parameter is iterable and parameter is not string %}
{%- for param, children in parameter.items() %}
- {{ param }}:
{%- for child in children %}
{%- for key, value in child.items() %}
- {{ key }}: {{ value }}
{%- endfor -%}
{%- endfor -%}
{%- endfor -%}
{%- else %}
- {{ parameter }}
{%- endif %}
{%- endfor -%}
{#- Workaround for missing `is mapping` on CentOS 6, see #193: #}
{%- elif 'dict' in pillar[key].__class__.__name__ and pillar[key] is not string %}

+ 11
- 0
salt/files/minion.d/f_defaults.conf 查看文件

@@ -842,7 +842,18 @@ ext_pillar:
{%- elif pillar[key] is iterable and 'dict' not in pillar[key].__class__.__name__ %}
- {{ key }}:
{%- for parameter in pillar[key] %}
{%- if parameter is iterable and parameter is not string %}
{%- for param, children in parameter.items() %}
- {{ param }}:
{%- for child in children %}
{%- for key, value in child.items() %}
- {{ key }}: {{ value }}
{%- endfor -%}
{%- endfor -%}
{%- endfor -%}
{%- else %}
- {{ parameter }}
{%- endif %}
{%- endfor -%}
{#- Workaround for missing `is mapping` on CentOS 6, see #193: #}
{%- elif 'dict' in pillar[key].__class__.__name__ and pillar[key] is not string %}

Loading…
取消
儲存