|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- {%- 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.interface is defined %}
- interface: {{ master.interface }}
- {%- endif %}
- {%- if master.max_open_files is defined %}
- max_open_files: {{ master.max_open_files }}
- {%- endif %}
- {%- if master.pki_dir is defined %}
- pki_dir: {{ master.pki_dir }}
- {%- endif %}
- {%- if master.cachedir is defined %}
- cachedir: {{ master.cachedir }}
- {%- endif %}
-
- state_output: {{ master.get('state_output', 'changes') }}
-
- {%- if master.gitfs_base is defined %}
- gitfs_base: {{ master.gitfs_base }}
- {%- endif %}
- {%- if master.gitfs_root is defined %}
- gitfs_root: {{ master.gitfs_root }}
- {%- endif %}
- {%- if master.gitfs_ssl_verify is defined %}
- gitfs_ssl_verify: {{ master.gitfs_ssl_verify }}
- {%- endif %}
- {%- if master.gitfs_mountpoint is defined %}
- gitfs_mountpoint: {{ master.gitfs_mountpoint }}
- {%- endif %}
- {%- if master.gitfs_user is defined %}
- gitfs_user: {{ master.gitfs_user }}
- {%- endif %}
- {%- if master.gitfs_password is defined %}
- gitfs_password: {{ master.gitfs_password }}
- {%- endif %}
- {%- if master.gitfs_insecure_auth is defined %}
- gitfs_insecure_auth: {{ master.gitfs_insecure_auth }}
- {%- endif %}
- {%- if master.gitfs_pubkey is defined %}
- gitfs_pubkey: {{ master.gitfs_pubkey }}
- {%- endif %}
- {%- if master.gitfs_privkey is defined %}
- gitfs_privkey: {{ master.gitfs_privkey }}
- {%- endif %}
- {%- if master.gitfs_passphrase is defined %}
- gitfs_passphrase: {{ master.gitfs_passphrase }}
- {%- endif %}
- {%- if master.gitfs_refspecs is defined %}
- gitfs_refspecs: {{ master.gitfs_refspecs }}
- {%- endif %}
- {%- if master.gitfs_disable_saltenv_mapping is defined %}
- gitfs_disable_saltenv_mapping: {{ master.gitfs_disable_saltenv_mapping }}
- {%- endif %}
- {%- if master.gitfs_ref_types is defined %}
- gitfs_ref_types: {{ master.gitfs_ref_types }}
- {%- endif %}
- {%- if master.gitfs_update_interval is defined %}
- gitfs_update_interval: {{ master.gitfs_update_interval }}
- {%- endif %}
-
- {%- if master.gitfs_remotes is defined %}
- gitfs_remotes:
- {%- for fs, fsparams in master.gitfs_remotes.items() %}
- {%- if fsparams.get('enabled', False) %}
- {%- if fsparams.params is defined %}
- - {{ fsparams.url }}:
- {%- for key, value in fsparams.params.iteritems() %}
- - {{ key }}: {{ value }}
- {%- endfor %}
- {%- else %}
- - {{ fsparams.url }}
- {%- endif %}
- {%- endif %}
- {%- endfor %}
- {%- endif %}
-
- {%- if master.system is defined %}
-
- file_roots:
- base:
- - {{ master.dir.files }}/{{ master.system.environment }}
- {%- for formula_name, formula in master.system.get('formula', {}).iteritems() %}
- - {{ master.dir.files }}/{{ master.system.environment }}/{{ formula_name }}
- {%- endfor %}
- {{ master.system.environment }}:
- - {{ master.dir.files }}/{{ master.system.environment }}
- {%- for formula_name, formula in master.system.get('formula', {}).iteritems() %}
- - {{ master.dir.files }}/{{ 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:
- - {{ master.dir.files }}/{{ environment_name }}
- {%- endif %}
- {{ environment_name }}:
- - {{ master.dir.files }}/{{ environment_name }}
- {%- endfor %}
-
- {%- endif %}
-
- pillar_opts: False
-
- pillar_safe_render_error: {{ master.pillar_safe_render_error }}
-
- {%- if master.accept_policy == 'open_mode' %}
- open_mode: True
- {%- endif %}
-
- {%- if master.accept_policy == 'auto_accept' %}
- auto_accept: True
- {%- endif %}
-
- {%- if master.max_event_size is defined %}
- max_event_size: {{ master.max_event_size }}
- {%- endif %}
-
- {%- if master.pillar.engine == 'salt' %}
- pillar_roots:
- base:
- - {{ master.pillar.get('salt', {}).get('path', '/srv/salt/pillar') }}
- {%- endif %}
-
- {%- if master.pillar.engine == 'architect' %}
- ext_pillar:
- - cmd_yaml: 'architect-salt-pillar %s'
-
- master_tops:
- ext_nodes: architect-salt-top
- {%- endif %}
-
- {%- if master.pillar.engine == 'reclass' or (master.pillar.engine == 'composite' and master.pillar.reclass is defined) %}
-
- reclass: &reclass
- storage_type: {{ master.pillar.get('reclass', {}).get('storage_type', 'yaml_fs') }}
- inventory_base_uri: {{ master.pillar.get('reclass', {}).get('inventory_base_uri', '/srv/salt/reclass') }}
- {# Additional options, for backward compatibility salt:master:pillar might not be defined #}
- {%- if master.pillar.reclass is defined %}
- {%- if master.pillar.reclass.reclass_source_path is defined %}
- reclass_source_path: {{ master.pillar.reclass.reclass_source_path }}
- {%- endif %}
- {%- if master.pillar.reclass.get('class_mappings', [])|length > 0 %}
- class_mappings:
- {%- for mapping in master.pillar.reclass.class_mappings %}
- - {{ mapping.target }} {{ mapping.class }}
- {%- endfor %}
- {%- endif %}
- {%- if master.pillar.reclass.get('propagate_pillar_data_to_reclass', False) == True %}
- propagate_pillar_data_to_reclass: {{ master.pillar.reclass.propagate_pillar_data_to_reclass }}
- {%- endif %}
- # Below options are not available in original reclass,
- # use fork with extensions from https://github.com/salt-formulas/reclass
- {%- if master.pillar.reclass.get('ignore_class_notfound', False) == True %}
- ignore_class_notfound: {{ master.pillar.reclass.ignore_class_notfound }}
- ignore_class_regexp: {{ master.pillar.reclass.ignore_class_regexp }}
- {%- endif %}
- {%- if master.pillar.reclass.allow_scalar_over_dict is defined %}
- allow_scalar_over_dict: {{ master.pillar.reclass.allow_scalar_over_dict }}
- {%- endif %}
- {%- if master.pillar.reclass.allow_scalar_over_list is defined %}
- allow_scalar_over_list: {{ master.pillar.reclass.allow_scalar_over_list }}
- {%- endif %}
- {%- if master.pillar.reclass.allow_list_over_scalar is defined %}
- allow_list_over_scalar: {{ master.pillar.reclass.allow_list_over_scalar }}
- {%- endif %}
- {%- if master.pillar.reclass.allow_dict_over_scalar is defined %}
- allow_dict_over_scalar: {{ master.pillar.reclass.allow_dict_over_scalar }}
- {%- endif %}
- {%- if master.pillar.reclass.allow_none_override is defined %}
- allow_none_override: {{ master.pillar.reclass.allow_none_override }}
- {%- endif %}
- {%- endif %}
- {%- endif %}
-
- {%- if master.pillar.engine == 'saltclass' or (master.pillar.engine == 'composite' and master.pillar.saltclass is defined ) %}
-
- saltclass: &saltclass
- path: {{ master.pillar.saltclass.get('path', '/srv/salt/saltclass') }}
- {%- endif %}
-
-
- {%- if master.pillar.engine in ['composite', 'reclass'] %}
- {# generate indexed list of ext_engines #}
- {# NONE: Might be rewritten, once proved to work properly, with filters: #}
- {# NONE: select('mapping')|selectattr('_index')|sort(attribute='_index') #}
- {%- set ext_engines = {} %}
- {%- for name,engine in master.pillar.iteritems() %}
- {%- if not engine is mapping %}{% continue %}{% endif %}
- {%- do engine.update({'name': engine.get('name', name) }) %}
- {%- set index = engine.get('index', '1')~'-'~name %}
- {%- do ext_engines.update({ index: engine }) %}
- {%- endfor %}
- {%- if ext_engines|length > 0 or master.pillar.engine == "reclass" %}
-
- ext_pillar:
- {%- if master.pillar.engine == 'reclass' %}
- {#- too keep backward compatibility, in case master.pillar.reclass is not defied at all #}
- - reclass: *reclass
- {%- endif %}
- {%- for name, engine in ext_engines|dictsort %}
- {%- if master.pillar.engine == 'composite' and engine.name == 'reclass' %}
- - reclass: *reclass
- {%- endif %}
- {%- if engine.name == 'saltclass' %}
- - saltclass: *saltclass
- {%- endif %}
- {%- if engine.name == 'nacl' %}
- - nacl: {}
- {%- endif %}
- {%- if engine.name == 'gpg' %}
- - gpg: {}
- {%- endif %}
- {%- endfor %}
- {%- endif %}
- {%- endif %}
- {%- if master.ext_pillars is defined %}
- {%- for _, ext_pillar in master.ext_pillars.items() %}
- - {{ ext_pillar.module }}: {{ ext_pillar.params }}
- {%- endfor %}
- {%- endif %}
-
- {%- if master.pillar.engine == 'reclass'
- or (master.pillar.engine == 'composite' and
- (master.pillar.saltclass is defined or
- master.pillar.reclass is defined )) %}
-
- master_tops:
- {%- if master.pillar.engine == 'reclass' or (master.pillar.engine == 'composite' and master.pillar.reclass is defined ) %}
- reclass: *reclass
- {%- endif %}
- {%- if master.pillar.engine == 'saltclass' or (master.pillar.engine == 'composite' and master.pillar.saltclass is defined ) %}
- saltclass: *saltclass
- {%- endif %}
- {%- endif %}
-
- {%- if master.log is defined %}
-
- {%- if master.log.level is defined %}
- log_level: {{ master.log.level }}
- {%- endif %}
-
- {%- if master.log.file is defined %}
- log_file: {{ master.log.file }}
- {%- endif %}
-
- {%- if master.log.level_logfile is defined %}
- log_level_logfile: {{ master.log.level_logfile }}
- {%- endif %}
-
- {%- endif %}
-
- {%- if pillar.salt.get('minion') %}
- {%- 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 %}
- {%- endif %}
-
- {%- if master.get('order_masters', False) %}
-
- order_masters: True
- {%- endif %}
-
- {%- if master.nacl is defined %}
-
- nacl.config:
- box_type: {{ master.nacl.get('box_type', 'sealedbox') }}
- {%- if master.nacl.sk is defined %}
- sk: {{ master.nacl.sk }}
- pk: {{ master.nacl.pk }}
- {%- else %}
- sk_file: {{ master.nacl.sk_file }}
- pk_file: {{ master.nacl.pk_file }}
- {%- endif %}
- {%- endif %}
-
- file_recv: {{ master.get('file_recv', False) }}
-
- id: {{ master.id | default(system.name~"."~system.domain) }}
-
- {#-
- vim: syntax=jinja
- -#}
|