server.sls 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # burp backup server
  3. #
  4. include:
  5. - burp
  6. burp-server:
  7. pkg.installed:
  8. - name: burp-server
  9. service.running:
  10. - enable: True
  11. - reload: True
  12. /etc/default/burp:
  13. file.managed:
  14. - source: salt://burp/server/default_burp
  15. - watch_in:
  16. - service: burp-server
  17. /etc/burp/burp-server.conf:
  18. file.managed:
  19. - source: salt://burp/server/burp-server.conf.tmpl
  20. - template: jinja
  21. - watch_in:
  22. - service: burp-server
  23. /etc/burp/clientconfdir:
  24. file.directory:
  25. - mode: 700
  26. /etc/burp/clientconfdir/incexc:
  27. file.directory:
  28. - require:
  29. - file: /etc/burp/clientconfdir
  30. /etc/burp/clientconfdir/incexc/common:
  31. file.managed:
  32. - source: salt://burp/server/common_incexc
  33. - require:
  34. - file: /etc/burp/clientconfdir/incexc
  35. - watch_in:
  36. - service: burp-server
  37. {% set nodes = salt['pillar.get']('nodes') %}
  38. {% for node, node_config in nodes.items()|sort if 'burp' in node_config %}
  39. /etc/burp/clientconfdir/{{ node }}:
  40. file.managed:
  41. - source: salt://burp/server/client.tmpl
  42. - template: jinja
  43. - context:
  44. node: {{ node }}
  45. burp_config: {{ node_config.get ('burp') }}
  46. - watch_in:
  47. - service: burp-server
  48. {% endfor %}