|
- {%- from "salt/map.jinja" import master with context %}
- {%- from "linux/map.jinja" import system with context %}
-
- worker_threads: {{ master.worker_threads }}
- timeout: {{ master.command_timeout }}
-
- {%- if master.system is defined %}
-
- file_roots:
- base:
- - /srv/salt/env/{{ master.system.environment }}
- {%- for formula_name, formula in master.system.get('formula', {}).iteritems() %}
- - /srv/salt/env/{{ master.system.environment }}/{{ formula_name }}
- {%- endfor %}
- {{ master.system.environment }}:
- - /srv/salt/env/{{ master.system.environment }}
- {%- for formula_name, formula in master.system.get('formula', {}).iteritems() %}
- - /srv/salt/env/{{ master.system.environment }}/{{ formula_name }}
- {%- endfor %}
-
- {%- else %}
-
- file_roots:
- {%- for environment_name, environment in master.get('environment', {}).iteritems() %}
- {%- if master.base_environment == environment_name %}
- base:
- - /srv/salt/env/{{ environment_name }}
- {%- endif %}
- {{ environment_name }}:
- - /srv/salt/env/{{ environment_name }}
- {%- endfor %}
-
- {%- endif %}
-
- pillar_opts: False
-
- {%- if master.accept_policy == 'open_mode' %}
- open_mode: True
- {%- endif %}
-
- {%- if master.accept_policy == 'auto_accept' %}
- auto_accept: True
- {%- endif %}
-
- {%- if master.pillar.engine == 'salt' %}
-
- pillar_roots:
- base:
- - /srv/salt/pillar
-
- {%- endif %}
-
- {%- if master.pillar.engine == 'reclass' %}
-
- reclass: &reclass
- storage_type: yaml_fs
- inventory_base_uri: /srv/salt/reclass
-
- ext_pillar:
- - reclass: *reclass
-
- master_tops:
- reclass: *reclass
-
- {%- endif %}
-
- {%- if master.acl is defined %}
-
- client_acl:
- {%- for acl in master.acl %}
- {{ acl.name }}:
- {%- for right in acl.rights %}
- - {{ right }}
- {%- endfor %}
- {%- endfor %}
-
- {%- endif %}
-
- {%- if master.bind.api is defined %}
-
- rest_cherrypy:
- port: {{ master.api.port }}
- ssl_crt: /etc/ssl/certs/{{ system.name }}.{{ system.domain }}.crt
- ssl_key: /etc/ssl/private/{{ system.name }}.{{ system.domain }}.key
- {%- if pillar.halite is defined %}
- static: /srv/halite/halite
- app: /srv/halite/halite/index.html
- {%- endif %}
- debug: True
-
- {%- endif %}
-
- {%- for handler in pillar.salt.minion.get("handlers", []) %}
-
- {%- if handler.engine == "udp"%}
- logstash_udp_handler:
- host: {{ handler.host }}
- port: {{ handler.port }}
- version: 1
- {%- endif %}
-
- {%- if handler.engine == "zmq"%}
- logstash_zmq_handler:
- address: tcp://{{ handler.host }}:{{ handler.port }}
- version: 1
- {%- endif %}
-
- {%- endfor %}
-
- {%- if master.syndic is defined %}
-
- {% if master.syndic.mode == 'master' %}
- order_masters: True
- {%- endif %}
-
- {% if master.syndic.mode == 'client' %}
- syndic_master: {{ master.syndic.host }}
- {%- endif %}
-
- {%- endif %}
|