New version of salt-formula from Saltstack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 line
2.3KB

  1. {%- from "salt/map.jinja" import master with context %}
  2. {%- from "linux/map.jinja" import system with context %}
  3. worker_threads: {{ master.worker_threads }}
  4. timeout: {{ master.command_timeout }}
  5. {%- if master.system is defined %}
  6. file_roots:
  7. base:
  8. - {{ master.dir.files }}/{{ master.system.environment }}
  9. {%- for formula_name, formula in master.system.get('formula', {}).iteritems() %}
  10. - {{ master.dir.files }}/{{ master.system.environment }}/{{ formula_name }}
  11. {%- endfor %}
  12. {{ master.system.environment }}:
  13. - {{ master.dir.files }}/{{ master.system.environment }}
  14. {%- for formula_name, formula in master.system.get('formula', {}).iteritems() %}
  15. - {{ master.dir.files }}/{{ master.system.environment }}/{{ formula_name }}
  16. {%- endfor %}
  17. {%- else %}
  18. file_roots:
  19. {%- for environment_name, environment in master.get('environment', {}).iteritems() %}
  20. {%- if master.base_environment == environment_name %}
  21. base:
  22. - {{ master.dir.files }}/{{ environment_name }}
  23. {%- endif %}
  24. {{ environment_name }}:
  25. - {{ master.dir.files }}/{{ environment_name }}
  26. {%- endfor %}
  27. {%- endif %}
  28. pillar_opts: False
  29. {%- if master.accept_policy == 'open_mode' %}
  30. open_mode: True
  31. {%- endif %}
  32. {%- if master.accept_policy == 'auto_accept' %}
  33. auto_accept: True
  34. {%- endif %}
  35. {%- if master.pillar.engine == 'salt' %}
  36. pillar_roots:
  37. base:
  38. - /srv/salt/pillar
  39. {%- endif %}
  40. {%- if master.pillar.engine == 'reclass' %}
  41. reclass: &reclass
  42. storage_type: yaml_fs
  43. inventory_base_uri: /srv/salt/reclass
  44. ext_pillar:
  45. - reclass: *reclass
  46. master_tops:
  47. reclass: *reclass
  48. {%- endif %}
  49. {%- if master.user is defined %}
  50. client_acl:
  51. {%- for user_name, user in master.user.iteritems() %}
  52. {{ user_name }}: {{ user.permissions|yaml }}
  53. {%- endfor %}
  54. {%- endif %}
  55. {%- for handler in pillar.salt.minion.get("handlers", []) %}
  56. {%- if handler.engine == "udp"%}
  57. logstash_udp_handler:
  58. host: {{ handler.host }}
  59. port: {{ handler.port }}
  60. version: 1
  61. {%- endif %}
  62. {%- if handler.engine == "zmq"%}
  63. logstash_zmq_handler:
  64. address: tcp://{{ handler.host }}:{{ handler.port }}
  65. version: 1
  66. {%- endif %}
  67. {%- endfor %}
  68. {%- if master.syndic is defined %}
  69. {% if master.syndic.mode == 'master' %}
  70. order_masters: True
  71. {%- endif %}
  72. {% if master.syndic.mode == 'client' %}
  73. syndic_master: {{ master.syndic.host }}
  74. {%- endif %}
  75. {%- endif %}