45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
---
|
|
- name: IOMMU Kernel-Parameter setzen (GRUB)
|
|
lineinfile:
|
|
path: /etc/default/grub
|
|
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT='
|
|
line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"'
|
|
register: grub_updated
|
|
notify: Update GRUB
|
|
|
|
- name: VFIO Module in /etc/modules eintragen
|
|
copy:
|
|
dest: /etc/modules
|
|
content: |
|
|
# /etc/modules - VFIO fuer GPU Passthrough
|
|
vfio
|
|
vfio_iommu_type1
|
|
vfio_pci
|
|
mode: "0644"
|
|
register: modules_updated
|
|
|
|
- name: Alte fehlerhafte modprobe Configs aufraeumen
|
|
file:
|
|
path: "{{ item }}"
|
|
state: absent
|
|
loop:
|
|
- /etc/modprobe.d/block-nouveau.conf
|
|
- /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
|
|
|
|
- name: NVIDIA und Nouveau auf Host blacklisten
|
|
copy:
|
|
dest: /etc/modprobe.d/gpu-passthrough.conf
|
|
content: |
|
|
blacklist nouveau
|
|
blacklist nvidia
|
|
blacklist nvidiafb
|
|
blacklist rivafb
|
|
options nouveau modeset=0
|
|
softdep nvidia pre: vfio-pci
|
|
softdep nouveau pre: vfio-pci
|
|
mode: "0644"
|
|
register: modprobe_updated
|
|
|
|
- name: initramfs aktualisieren
|
|
command: update-initramfs -u -k all
|
|
when: grub_updated.changed or modules_updated.changed or modprobe_updated.changed
|