base.sls 902 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #
  2. # network.interface.base
  3. #
  4. # Install required packets and write /etc/network/interfaces but don't apply it!
  5. ifupdown2:
  6. pkg.installed
  7. # Require for some functions of ffho_net module, so make sure they are present.
  8. # Used by functions for bird and dhcp-server for example.
  9. python-network-pkgs:
  10. pkg.installed:
  11. - pkgs:
  12. {% if grains.oscodename == "buster" %}
  13. - python3-ipaddress
  14. {% else %}
  15. - python-ipaddress
  16. {% endif %}
  17. # ifupdown2 configuration
  18. /etc/network/ifupdown2/ifupdown2.conf:
  19. file.managed:
  20. - source:
  21. - salt://network/ifupdown2.conf.{{ grains['oscodename'] }}
  22. - salt://network/ifupdown2.conf
  23. - require:
  24. - pkg: ifupdown2
  25. - pkg: python-network-pkgs
  26. # Write network configuration
  27. /etc/network/interfaces:
  28. file.managed:
  29. - template: jinja
  30. - source: salt://network/interfaces/interfaces.tmpl
  31. - require:
  32. - pkg: ifupdown2