Saltstack Official Salt Formula
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.

27 lines
839B

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. ---
  4. {#- Get the `tplroot` from `tpldir` #}
  5. {%- set tplroot = tpldir.split("/")[0] %}
  6. {%- from tplroot ~ "/map.jinja" import salt_settings with context %}
  7. {%- from tplroot ~ "/map.jinja" import formulas_settings with context %}
  8. {%- set _mapdata = {
  9. "values": {
  10. "salt_settings": salt_settings,
  11. "formulas_settings": formulas_settings,
  12. }
  13. } %}
  14. {%- do salt["log.debug"]("### MAP.JINJA DUMP ###\n" ~ _mapdata | yaml(False)) %}
  15. {%- set output_dir = "/temp" if grains.os_family == "Windows" else "/tmp" %}
  16. {%- set output_file = output_dir ~ "/salt_mapdata_dump.yaml" %}
  17. {{ tplroot }}-mapdata-dump:
  18. file.managed:
  19. - name: {{ output_file }}
  20. - source: salt://{{ tplroot }}/_mapdata/_mapdata.jinja
  21. - template: jinja
  22. - context:
  23. map: {{ _mapdata | yaml }}