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.

51 lines
1.2KB

  1. {% if grains['os_family'] == 'Debian' %}
  2. {% from "apt-cacher/ng/map.jinja" import apt_cacher_ng with context %}
  3. apt-cacher-ng:
  4. pkg:
  5. - installed
  6. - name: {{ apt_cacher_ng.pkg }}
  7. service:
  8. - running
  9. - name: {{ apt_cacher_ng.service }}
  10. - enable: True
  11. - watch:
  12. - pkg: {{ apt_cacher_ng.pkg }}
  13. - file: {{ apt_cacher_ng.credentials }}
  14. - file: {{ apt_cacher_ng.server_config }}
  15. - file: {{ apt_cacher_ng.server_cache_dir }}
  16. - file: {{ apt_cacher_ng.server_log_dir }}
  17. {{ apt_cacher_ng.server_config }}:
  18. file:
  19. - managed
  20. - user: root
  21. - group: root
  22. - mode: '644'
  23. - source: salt://apt-cacher/ng/files/server.conf
  24. - template: jinja
  25. {{ apt_cacher_ng.server_cache_dir }}:
  26. file:
  27. - directory
  28. - user: {{ apt_cacher_ng.user }}
  29. - group: {{ apt_cacher_ng.group }}
  30. - mode: '2755'
  31. {{ apt_cacher_ng.server_log_dir }}:
  32. file:
  33. - directory
  34. - user: {{ apt_cacher_ng.user }}
  35. - group: {{ apt_cacher_ng.group }}
  36. - mode: '2755'
  37. {{ apt_cacher_ng.credentials }}:
  38. file:
  39. - managed
  40. - user: {{ apt_cacher_ng.user }}
  41. - group: {{ apt_cacher_ng.group }}
  42. - mode: '600'
  43. - source: salt://apt-cacher/ng/files/security.conf
  44. - template: jinja
  45. {% endif %}