New version of salt-formula from Saltstack
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

78 lines
1.8KB

  1. {%- from "salt/map.jinja" import master with context %}
  2. {%- if master.enabled %}
  3. {%- if master.pillar.engine == 'salt' %}
  4. include:
  5. - git.client
  6. - salt.master.service
  7. {{ master.pillar.source.address }}:
  8. git.latest:
  9. - target: /srv/salt/pillar
  10. - rev: {{ master.pillar.source.branch }}
  11. - require:
  12. - file: /srv/salt/env
  13. - pkg: git_packages
  14. {%- if master.system is defined %}
  15. /srv/salt/env/{{ master.system.environment }}/top.sls:
  16. file.symlink:
  17. - target: /srv/salt/pillar/files_top.sls
  18. - require:
  19. - file: /srv/salt/env/{{ master.system.environment }}
  20. {%- endif %}
  21. {%- elif master.pillar.engine == 'reclass' %}
  22. include:
  23. - reclass.storage.data
  24. /srv/salt/reclass/classes/service:
  25. file.directory
  26. {%- if master.system is defined %}
  27. {%- for formula_name, formula in master.system.get('formula', {}).iteritems() %}
  28. /srv/salt/reclass/classes/service/{{ formula_name }}:
  29. file.symlink:
  30. - target: /srv/salt/env/{{ master.system.environment }}/{{ formula_name }}/metadata/service
  31. - require:
  32. - git: reclass_data_source
  33. - file: /srv/salt/reclass/classes/service
  34. {%- endfor %}
  35. {%- else %}
  36. {%- for environment_name, environment in master.environment.iteritems() %}
  37. {%- for formula_name, formula in environment.get('formula', {}).iteritems() %}
  38. {%- if environment_name == master.base_environment %}
  39. /srv/salt/reclass/classes/service/{{ formula_name }}:
  40. file.symlink:
  41. {%- if formula.source == 'pkg' %}
  42. - target: /usr/share/salt-formulas/reclass/service/{{ formula_name }}
  43. {%- else %}
  44. - target: /usr/share/salt-formulas/env/_formulas/{{ formula_name }}/metadata/service
  45. {%- endif %}
  46. - require:
  47. - git: reclass_data_source
  48. - file: /srv/salt/reclass/classes/service
  49. {%- endif %}
  50. {%- endfor %}
  51. {%- endfor %}
  52. {%- endif %}
  53. {%- endif %}
  54. {%- endif %}