Browse Source

more improvements in _defaults.conf

better newlines with iterations.
master
Niels Abspoel 10 years ago
parent
commit
af7f9d722a
2 changed files with 40 additions and 39 deletions
  1. +39
    -38
      salt/files/master.d/_defaults.conf
  2. +1
    -1
      salt/files/minion.d/_defaults.conf

+ 39
- 38
salt/files/master.d/_defaults.conf View File

# This file managed by Salt, do not edit by hand!! # This file managed by Salt, do not edit by hand!!
# Based on salt version 0.17.4 default config # Based on salt version 0.17.4 default config
{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs'] %}
{% set salt = pillar.get('salt', {}) %}
{% set master = salt.get('master', {}) %}
{% macro get_config(configname, default_value) %}
{% if configname in master %}
{% set reserved_keys = ['master', 'minion', 'cloud', 'salt_cloud_certs'] -%}
{% set salt = pillar.get('salt', {}) -%}
{% set master = salt.get('master', {}) -%}
{%- macro get_config(configname, default_value) -%}
{%- if configname in master -%}
{{ configname }}: {{ master[configname] }} {{ configname }}: {{ master[configname] }}
{% elif configname in salt and configname not in reserved_keys %}
{%- elif configname in salt and configname not in reserved_keys -%}
{{ configname }}: {{ salt[configname] }} {{ configname }}: {{ salt[configname] }}
{% else %}
{%- else -%}
#{{ configname }}: {{ default_value }} #{{ configname }}: {{ default_value }}
{% endif %}
{% endmacro %}
{%- endif -%}
{%- endmacro -%}
##### Primary configuration settings ##### ##### Primary configuration settings #####
########################################## ##########################################
# This configuration file is used to manage the behavior of the Salt Master # This configuration file is used to manage the behavior of the Salt Master
# prod: # prod:
# - /srv/salt/prod/services # - /srv/salt/prod/services
# - /srv/salt/prod/states # - /srv/salt/prod/states
{% if 'file_roots' in master %}
{% if 'file_roots' in master -%}
file_roots: file_roots:
{% for name, roots in master['file_roots']|dictsort %}
{%- for name, roots in master['file_roots']|dictsort %}
{{ name }}: {{ name }}:
{% for dir in roots %}
{%- for dir in roots %}
- {{ dir }} - {{ dir }}
{% endfor %}
{% endfor %}
{% elif 'file_roots' in salt %}
{%- endfor -%}
{%- endfor -%}
{% elif 'file_roots' in salt -%}
file_roots: file_roots:
{% for name, roots in salt['file_roots']|dictsort %}
{%- for name, roots in salt['file_roots']|dictsort %}
{{ name }}: {{ name }}:
{% for dir in roots %}
{%- for dir in roots %}
- {{ dir }} - {{ dir }}
{% endfor %}
{% endfor %}
{% else %}
{%- endfor -%}
{%- endfor -%}
{% else -%}
#file_roots: #file_roots:
# base: # base:
# - /srv/salt # - /srv/salt
{% endif %}
{%- endif %}



# The hash_type is the hash to use when discovering the hash of a file on # The hash_type is the hash to use when discovering the hash of a file on
# the master server. The default is md5, but sha1, sha224, sha256, sha384 # the master server. The default is md5, but sha1, sha224, sha256, sha384
#fileserver_backend: #fileserver_backend:
# - git # - git
# - roots # - roots
{% if 'fileserver_backend' in master %}
{% if 'fileserver_backend' in master -%}
fileserver_backend: fileserver_backend:
{% for backend in master['fileserver_backend'] %}
{%- for backend in master['fileserver_backend'] %}
- {{ backend }} - {{ backend }}
{% endfor %}
{% endif %}
{%- endfor -%}
{%- endif %}
# #
# Uncomment the line below if you do not want the file_server to follow # Uncomment the line below if you do not want the file_server to follow
# symlinks when walking the filesystem tree. This is set to True # symlinks when walking the filesystem tree. This is set to True
# environments. # environments.
# Note: file:// repos will be treated as a remote, so refs you want used must # Note: file:// repos will be treated as a remote, so refs you want used must
# exist in that repo as *local* refs. # exist in that repo as *local* refs.
{% if 'gitfs_remotes' in master %}
{% if 'gitfs_remotes' in master -%}
gitfs_remotes: gitfs_remotes:
{% for remote in master['gitfs_remotes'] %}
{% if remote is iterable and remote is not string %}
{% for repo, children in remote.iteritems() %}
{%- for remote in master['gitfs_remotes'] %}
{%- if remote is iterable and remote is not string %}
{%- for repo, children in remote.iteritems() %}
- {{ repo }}: - {{ repo }}:
{% for child in children %}
{% for key, value in child.iteritems() %}
{%- for child in children %}
{%- for key, value in child.iteritems() %}
- {{ key }}: {{ value }} - {{ key }}: {{ value }}
{% endfor %}
{% endfor %}
{% endfor %}
{% else %}
{%- endfor -%}
{%- endfor -%}
{%- endfor -%}
{%- else %}
- {{ remote }} - {{ remote }}
{% endif %}
{% endfor %}
{% endif %}
{%- endif -%}
{%- endfor -%}
{%- endif %}
# #
#gitfs_remotes: #gitfs_remotes:
# - git://github.com/saltstack/salt-states.git # - git://github.com/saltstack/salt-states.git

+ 1
- 1
salt/files/minion.d/_defaults.conf View File

- {{ remote }} - {{ remote }}
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}
{%- endif -%}
{%- endif %}
# #
#gitfs_remotes: #gitfs_remotes:
# - git://github.com/saltstack/salt-states.git # - git://github.com/saltstack/salt-states.git

Loading…
Cancel
Save