Saltstack Official Apt-Cacher 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.

50 satır
1.3KB

  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 ~ "/ng/defaults.yaml" as default_settings %}
  7. {%- import_yaml tplroot ~ "/ng/osarchmap.yaml" as osarchmap %}
  8. {%- import_yaml tplroot ~ "/ng/osfamilymap.yaml" as osfamilymap %}
  9. {%- import_yaml tplroot ~ "/ng/osmap.yaml" as osmap %}
  10. {%- import_yaml tplroot ~ "/ng/osfingermap.yaml" as osfingermap %}
  11. {#- Retrieve the config dict only once #}
  12. {%- set _config = salt['config.get']('apt_cacher_ng', default={}) %}
  13. {%- set defaults = salt['grains.filter_by'](
  14. default_settings,
  15. default='apt_cacher_ng',
  16. merge=salt['grains.filter_by'](
  17. osarchmap,
  18. grain='osarch',
  19. merge=salt['grains.filter_by'](
  20. osfamilymap,
  21. grain='os_family',
  22. merge=salt['grains.filter_by'](
  23. osmap,
  24. grain='os',
  25. merge=salt['grains.filter_by'](
  26. osfingermap,
  27. grain='osfinger',
  28. merge=salt['grains.filter_by'](
  29. _config,
  30. default='lookup'
  31. )
  32. )
  33. )
  34. )
  35. )
  36. )
  37. %}
  38. {%- set config = salt['grains.filter_by'](
  39. {'defaults': defaults},
  40. default='defaults',
  41. merge=_config
  42. )
  43. %}
  44. {%- set apt_cacher_ng = config %}