New version of salt-formula from Saltstack
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

_orchestration.conf 1.4KB

1234567891011121314151617181920212223
  1. {%- from "salt/map.jinja" import master with context %}
  2. {%- if master.enabled %}
  3. {%- for environment_name, environment in master.get('environment', {}).iteritems() %}
  4. {%- set formulas = environment.get('formula', {}) %}
  5. {%- set priorities = {'orchestration':{'deploy':{'applications':{}}, 'upgrade': {'applications': {}}}} %}
  6. {%- for formula_name, formula in formulas.iteritems() %}
  7. {%- if salt['file.file_exists'](master.dir.files+'/'+environment_name+'/'+formula_name+'/meta/salt.yml') %}
  8. {%- set orch_fragment_file = formula_name+'/meta/salt.yml' %}
  9. {%- macro load_orch_file() %}{% include orch_fragment_file %}{% endmacro %}
  10. {%- set orch_yaml = load_orch_file()|load_yaml %}
  11. {%- if orch_yaml.orchestration is defined %}
  12. {%- if orch_yaml.orchestration.deploy is defined %}
  13. {%- do priorities['orchestration']['deploy']['applications'].update({ formula_name: orch_yaml['orchestration']['deploy']['applications'][formula_name] }) %}
  14. {%- endif %}
  15. {%- if orch_yaml.orchestration.upgrade is defined %}
  16. {%- do priorities['orchestration']['upgrade']['applications'].update({ formula_name: orch_yaml['orchestration']['upgrade']['applications'][formula_name] }) %}
  17. {%- endif %}
  18. {%- endif %}
  19. {%- endif %}
  20. {%- endfor %}
  21. {{ priorities|yaml(False) }}
  22. {%- endfor %}
  23. {%- endif %}