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.

21 lines
1.1KB

  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':{}}}} %}
  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. {%- do priorities['orchestration']['deploy']['applications'].update({ formula_name: orch_yaml['orchestration']['deploy']['applications'][formula_name] }) %}
  13. {%- endif %}
  14. {%- endif %}
  15. {%- endfor %}
  16. {%- if priorities.orchestration.deploy.applications -%}
  17. {{ priorities|yaml(False) }}
  18. {%- endif %}
  19. {%- endfor %}
  20. {%- endif %}