init.sls 840 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. - ipv6calc
  17. - require_in:
  18. - file: /etc/network/interfaces
  19. vnstat:
  20. pkg.installed:
  21. - name: vnstat
  22. service.running:
  23. - restart: True
  24. /etc/vnstat.conf:
  25. file.managed:
  26. - source: salt://network/vnstat.conf
  27. - watch_in:
  28. - service: vnstat
  29. # /etc/resolv.conf
  30. /etc/resolv.conf:
  31. file.managed:
  32. - source:
  33. - salt://network/resolv.conf.H_{{ grains.id }}
  34. - salt://network/resolv.conf
  35. - template: jinja