2
0

Fix nested file,pillar _roots in minion and master templates

See #37 "Fixed file_roots config generation with several environment"
This commit is contained in:
Wes Turner 2014-07-22 00:43:24 -05:00
parent 760fa3ccdb
commit bc7ccedf45
2 changed files with 24 additions and 24 deletions

View File

@ -521,9 +521,9 @@ pillar_roots:
{%- endfor -%} {%- endfor -%}
{% elif 'pillar_roots' in salt -%} {% elif 'pillar_roots' in salt -%}
pillar_roots: pillar_roots:
{%- for name, roots in salt['pillar_roots'].items() -%} {%- for name, roots in salt['pillar_roots']|dictsort %}
{{ name }}: {{ name }}:
{%- for dir in roots -%} {%- for dir in roots %}
- {{ dir }} - {{ dir }}
{%- endfor -%} {%- endfor -%}
{%- endfor -%} {%- endfor -%}

View File

@ -404,20 +404,20 @@ id: {{ minion['id'] }}
# #
{% if 'file_roots' in minion -%} {% if 'file_roots' in minion -%}
file_roots: file_roots:
{% for name, roots in minion['file_roots'].items() -%} {%- for name, roots in minion['file_roots']|dictsort %}
{{ name }}: {{ name }}:
{% for dir in roots -%} {%- for dir in roots %}
- {{ dir }} - {{ dir }}
{% endfor -%} {%- endfor -%}
{% endfor -%} {%- endfor -%}
{% elif 'file_roots' in salt -%} {% elif 'file_roots' in salt -%}
file_roots: file_roots:
{% for name, roots in salt['file_roots'].items() -%} {%- for name, roots in salt['file_roots']|dictsort %}
{{ name }}: {{ name }}:
{% for dir in roots -%} {%- for dir in roots %}
- {{ dir }} - {{ dir }}
{% endfor -%} {%- endfor -%}
{% endfor -%} {%- endfor -%}
{% else -%} {% else -%}
#file_roots: #file_roots:
# base: # base:
@ -444,24 +444,24 @@ file_roots:
# also be configured on the minion: # also be configured on the minion:
{% if 'pillar_roots' in minion -%} {% if 'pillar_roots' in minion -%}
pillar_roots: pillar_roots:
{% for name, roots in minion['pillar_roots'].items() -%} {%- for name, roots in minion['pillar_roots']|dictsort %}
{{ name }}: {{ name }}:
{% for dir in roots -%} {%- for dir in roots %}
- {{ dir }} - {{ dir }}
{% endfor -%} {%- endfor -%}
{% endfor -%} {%- endfor -%}
{% elif 'pillar_roots' in salt -%} {% elif 'pillar_roots' in salt -%}
pillar_roots: pillar_roots:
{% for name, roots in salt['pillar_roots'].items() -%} {%- for name, roots in salt['pillar_roots']|dictsort %}
{{ name }}: {{ name }}:
{% for dir in roots -%} {%- for dir in roots %}
- {{ dir }} - {{ dir }}
{% endfor -%} {%- endfor -%}
{% endfor -%} {%- endfor -%}
{% else %} {% else -%}
#pillar_roots: #pillar_roots:
# base: # base:
# - /srv/pillar # - /srv/salt
{%- endif %} {%- endif %}
###### Security settings ##### ###### Security settings #####