link.sls 688 B

123456789101112131415161718192021222324252627
  1. #
  2. # Networking / link
  3. #
  4. {% if grains['oscodename'] == 'jessie' %}
  5. # Udev rules
  6. /etc/udev/rules.d/42-ffho-net.rules:
  7. file.managed:
  8. - template: jinja
  9. - source: salt://network/udev-rules.tmpl
  10. # Stretch, Buster, ...
  11. {% else %}
  12. # Systemd link files?
  13. {% for iface, iface_config in salt['pillar.get']('nodes:' ~ grains['id'] ~ ':ifaces', {}).items ()|sort %}
  14. {% if 'mac' in iface_config %}
  15. /etc/systemd/network/42-{{ iface }}.link:
  16. file.managed:
  17. - source: salt://network/systemd-link.tmpl
  18. - template: jinja
  19. interface: {{ iface }}
  20. iface_config: {{ iface_config }}
  21. desc: {{ iface_config.get ('desc', '') }}
  22. {% endif %}
  23. {% endfor %}
  24. {% endif %}