SuperTux88's Diaspora Saltstack 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.

45 line
1.1KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=jinja
  3. {#- Get the `tplroot` from `tpldir` #}
  4. {%- set tplroot = tpldir.split('/')[0] %}
  5. {#- Start imports as #}
  6. {%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
  7. {%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
  8. {%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
  9. {%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
  10. {#- Retrieve the config dict only once #}
  11. {%- set _config = salt['config.get'](tplroot, default={}) %}
  12. {%- set defaults = salt['grains.filter_by'](
  13. default_settings,
  14. default=tplroot,
  15. merge=salt['grains.filter_by'](
  16. osfamilymap,
  17. grain='os_family',
  18. merge=salt['grains.filter_by'](
  19. osmap,
  20. grain='os',
  21. merge=salt['grains.filter_by'](
  22. osfingermap,
  23. grain='osfinger',
  24. merge=salt['grains.filter_by'](
  25. _config,
  26. default='lookup'
  27. )
  28. )
  29. )
  30. )
  31. )
  32. %}
  33. {%- set config = salt['grains.filter_by'](
  34. {'defaults': defaults},
  35. default='defaults',
  36. merge=_config
  37. )
  38. %}
  39. {%- set diaspora = config %}