|
|
|
|
|
|
|
|
# master_tops: |
|
|
# master_tops: |
|
|
# ext_nodes: <Shell command which returns yaml> |
|
|
# ext_nodes: <Shell command which returns yaml> |
|
|
# |
|
|
# |
|
|
{{ get_config('master_tops', '{}') }} |
|
|
|
|
|
|
|
|
{% if 'master_tops' in cfg_master %} |
|
|
|
|
|
master_tops: |
|
|
|
|
|
{%- for master in cfg_master['master_tops'] -%} |
|
|
|
|
|
{%- if cfg_master['master_tops'][master] is string %} |
|
|
|
|
|
{{ master }}: {{ cfg_master['master_tops'][master] }} |
|
|
|
|
|
{%- else %} |
|
|
|
|
|
{{ master}}: |
|
|
|
|
|
{%- for parameter in cfg_master['master_tops'][master] %} |
|
|
|
|
|
{{ parameter }}: {{ cfg_master['master_tops'][master][parameter] }} |
|
|
|
|
|
{%- endfor -%} |
|
|
|
|
|
{%- endif -%} |
|
|
|
|
|
{%- endfor %} |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
# The external_nodes option allows Salt to gather data that would normally be |
|
|
# The external_nodes option allows Salt to gather data that would normally be |
|
|
# placed in a top file. The external_nodes option is the executable that will |
|
|
# placed in a top file. The external_nodes option is the executable that will |
|
|
|
|
|
|
|
|
# |
|
|
# |
|
|
{% if 'ext_pillar' in cfg_master %} |
|
|
{% if 'ext_pillar' in cfg_master %} |
|
|
ext_pillar: |
|
|
ext_pillar: |
|
|
{% for pillar in cfg_master['ext_pillar'] %} |
|
|
|
|
|
- {{ pillar.items()[0][0] }}: {{ pillar.items()[0][1] }} |
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{%- for pillar in cfg_master['ext_pillar'] -%} |
|
|
|
|
|
{%- for key in pillar -%} |
|
|
|
|
|
{%- if pillar[key] is string %} |
|
|
|
|
|
- {{ key }}: {{ pillar[key] }} |
|
|
|
|
|
{%- elif pillar[key] is iterable and pillar[key] is not mapping %} |
|
|
|
|
|
- {{ key }}: |
|
|
|
|
|
{%- for parameter in pillar[key] %} |
|
|
|
|
|
- {{ parameter }} |
|
|
|
|
|
{%- endfor -%} |
|
|
|
|
|
{%- elif pillar[key] is mapping and pillar[key] is not string %} |
|
|
|
|
|
- {{ key }}: |
|
|
|
|
|
{%- for parameter in pillar[key] %} |
|
|
|
|
|
{{ parameter }}: {{pillar[key][parameter]}} |
|
|
|
|
|
{%- endfor %} |
|
|
|
|
|
{%- else %} |
|
|
|
|
|
# Error in rendering {{ key }}, please read https://docs.saltstack.com/en/latest/topics/development/external_pillars.html#configuration |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
{%- endfor -%} |
|
|
|
|
|
{%- endfor %} |
|
|
{% elif 'ext_pillar' in cfg_salt %} |
|
|
{% elif 'ext_pillar' in cfg_salt %} |
|
|
ext_pillar: |
|
|
ext_pillar: |
|
|
{% for pillar in cfg_salt['ext_pillar'] %} |
|
|
{% for pillar in cfg_salt['ext_pillar'] %} |