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.

32 line
952B

  1. {%- from "salt/map.jinja" import master with context %}
  2. {%- if master.enabled %}
  3. {%- for environment_name, environment in master.get('environment', {}).iteritems() %}
  4. {%- if master.base_environment == environment_name %}
  5. {%- set formula_dict = {} %}
  6. {%- for formula_name, formula in formula_dict.iteritems() %}
  7. {%- if salt['file.file_exists']('salt://'+formula_name+'/meta/salt.yml') %}
  8. {%- set grains_fragment_file = formula_name+'/meta/salt.yml' %}
  9. {%- macro load_grains_file() %}{% include grains_fragment_file %}{% endmacro %}
  10. {%- set grains_yaml = load_grains_file()|load_yaml %}
  11. {% _dummy = formula_dict.update{formula_name: grains_yaml.orchestrate }}
  12. {%- else %}
  13. {%- endif %}
  14. {%- endfor %}
  15. /srv/salt/env/{{ environment_name}}/orchestrate.sls:
  16. file.managed:
  17. - source: salt://salt/files/orchestrate.sls
  18. - user: root
  19. - template: jinja
  20. - defaults:
  21. formula_dict: {{ formula_dict|yaml }}
  22. {%- endif %}
  23. {%- endfor %}
  24. {%- endif %}