New version of salt-formula from Saltstack
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

pillar.sls 1.9KB

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