init.sls 672 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #
  2. # KVM host
  3. #
  4. virt-pkgs:
  5. pkg.installed:
  6. - pkgs:
  7. {% if grains.oscodename == 'buster' %}
  8. - qemu-kvm
  9. - libvirt-bin
  10. {% elif grains.oscodename == 'bullseye' %}
  11. - qemu-system-x86
  12. - libvirt-daemon-system
  13. {% endif %}
  14. - xmlstarlet
  15. - netcat-openbsd
  16. libvirtd:
  17. service.running:
  18. - enable: True
  19. - reload: True
  20. /etc/libvirt/hooks/qemu:
  21. file.managed:
  22. - source: salt://kvm/qemu-hook
  23. - mode: 755
  24. - require:
  25. - pkg: virt-pkgs
  26. - watch_in:
  27. - service: libvirtd
  28. /etc/libvirt/hooks/get-bridge-vids:
  29. file.managed:
  30. - source: salt://kvm/get-bridge-vids
  31. - mode: 755
  32. - require:
  33. - pkg: virt-pkgs