init.sls 904 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. # Networking
  3. #
  4. # Which networ suite to configure?
  5. {% set default_suite = salt['pillar.get']('network:suite', 'ifupdown2') %}
  6. {% set suite = salt['pillar.get']('nodes:' ~ grains['id'] ~ ':network:suite', default_suite) %}
  7. include:
  8. - network.link
  9. - network.{{ suite }}
  10. - network.interfaces
  11. - network.{{ suite }}.reload
  12. network-pkg:
  13. pkg.installed:
  14. - pkgs:
  15. - iproute2
  16. - tcpdump
  17. - mtr-tiny
  18. - iperf
  19. - dnsutils
  20. - ipv6calc
  21. - require_in:
  22. - file: /etc/network/interfaces
  23. vnstat:
  24. pkg.installed:
  25. - name: vnstat
  26. service.running:
  27. - restart: True
  28. /etc/vnstat.conf:
  29. file.managed:
  30. - source: salt://network/vnstat.conf
  31. - watch_in:
  32. - service: vnstat
  33. # /etc/resolv.conf
  34. /etc/resolv.conf:
  35. file.managed:
  36. - source:
  37. - salt://network/resolv.conf.H_{{ grains.id }}
  38. - salt://network/resolv.conf
  39. - template: jinja