server.sls 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. - restart: 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 and node_config['burp'].get ('password', False) %}
  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. {% endfor %}