Saltstack Official Linux Formula
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

37 lines
1.4KB

  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- macro load_support_file(file, pillar, grains) %}{% include file %}{% endmacro %}
  3. {%- if system.enabled %}
  4. {%- for config_name, config in system.get('config', {}).iteritems() %}
  5. {%- if config.enabled|default(True) %}
  6. {%- for service_name in config.pillar.keys() %}
  7. {%- if pillar.get(service_name, {}).get('_support', {}).get('config', {}).get('enabled', False) %}
  8. {%- set support_fragment_file = service_name+'/meta/config.yml' %}
  9. {%- set service_config_files = load_support_file(support_fragment_file, config.pillar, config.get('grains', {}))|load_yaml %}
  10. {%- for service_config_name, service_config in service_config_files.config.iteritems() %}
  11. {{ service_config.path }}:
  12. file.managed:
  13. - source: {{ service_config.source }}
  14. {%- if service_config.template is defined %}
  15. - template: {{ service_config.template }}
  16. {%- endif %}
  17. - makedirs: true
  18. - defaults:
  19. pillar: {{ config.pillar|yaml }}
  20. grains: {{ config.get('grains', {}) }}
  21. {%- for key, value in service_config.get('defaults', {}).iteritems() %}
  22. {{ key }}: {{ value }}
  23. {%- endfor %}
  24. {%- endfor %}
  25. {%- endif %}
  26. {%- endfor %}
  27. {%- else %}
  28. {# TODO: configmap not using support between formulas #}
  29. {%- endif %}
  30. {%- endfor %}
  31. {%- endif %}