瀏覽代碼

Factorize minion grains generation

pull/35/head
Swann Croiset 7 年之前
父節點
當前提交
7d792fe76f
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. +5
    -5
      salt/files/minion.conf

+ 5
- 5
salt/files/minion.conf 查看文件

@@ -22,24 +22,24 @@ master: {{ minion.master.host }}

id: {{ system.name }}.{{ system.domain }}

{%- set excluded_keys = ('master', 'system', 'public_keys', 'private_keys', 'known_hosts', '__reclass__', '_secret', '_param') %}

grains:
{%- if minion.get('manage_roles', True) %}
roles:
{%- for key, value in pillar.items() %}
{%- if key != 'master' and key != 'system' and key != 'public_keys' and key != 'private_keys' and key != 'known_hosts' and key != '__reclass__' and key != '_secret' and key != '_param' %}
{%- if key not in excluded_keys %}
{%- for subkey, subvalue in value.iteritems() %}
{%- if subvalue.enabled is defined %}
{%- if subvalue.enabled %}
{%- if subvalue.enabled is defined and subvalue.enabled %}
- {{key}}.{{ subkey }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endif %}
services:
{%- for key, value in pillar.items() %}
{%- if key != 'master' and key != 'system' and key != 'public_keys' and key != 'private_keys' and key != 'known_hosts' and key != '__reclass__' and key != '_secret' and key != '_param' %}
{%- if key not in excluded_keys %}
- {{key}}
{%- endif %}
{%- endfor %}

Loading…
取消
儲存