Checkpoint

This commit is contained in:
Jonathan Cremin 2021-04-11 16:00:07 +01:00
parent e17f84ad8a
commit 1e03c32201
32 changed files with 556 additions and 298 deletions

View file

@ -1,16 +1,5 @@
---
- name: Install vm deps
apt:
name:
- libvirt-daemon-system
- libvirt-clients
- qemu-kvm
- qemu-utils
- virt-manager
- ovmf
become: yes
- name: Update grub for amd_iommu
lineinfile:
path: /etc/default/grub
@ -19,50 +8,50 @@
line: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=on"'
become: yes
- name: Create subdirectories
file:
dest: '{{item}}'
mode: '0755'
owner: root
group: root
state: directory
with_items:
- /etc/libvirt/hooks/
- /etc/libvirt/hooks/qemu.d/win10/prepare/begin/
- /etc/libvirt/hooks/qemu.d/win10/release/end/
become: yes
# - name: Create subdirectories
# file:
# dest: '{{item}}'
# mode: '0755'
# owner: root
# group: root
# state: directory
# with_items:
# - /etc/libvirt/hooks/
# - /etc/libvirt/hooks/qemu.d/win10/prepare/begin/
# - /etc/libvirt/hooks/qemu.d/win10/release/end/
# become: yes
- name: Fetch libvirt qemu hook
get_url:
url: https://raw.githubusercontent.com/PassthroughPOST/VFIO-Tools/master/libvirt_hooks/qemu
dest: /etc/libvirt/hooks/qemu
mode: 0744
become: yes
notify: restart libvirtd
# - name: Fetch libvirt qemu hook
# get_url:
# url: https://raw.githubusercontent.com/PassthroughPOST/VFIO-Tools/master/libvirt_hooks/qemu
# dest: /etc/libvirt/hooks/qemu
# mode: 0744
# become: yes
# notify: restart libvirtd
- name: Create kvm.conf
template:
src: kvm.conf.j2
dest: /etc/libvirt/hooks/kvm.conf
owner: root
group: root
mode: '0644'
become: yes
# - name: Create kvm.conf
# template:
# src: kvm.conf.j2
# dest: /etc/libvirt/hooks/kvm.conf
# owner: root
# group: root
# mode: '0644'
# become: yes
- name: bind_vfio.sh
template:
src: bind_vfio.sh.j2
dest: /etc/libvirt/hooks/qemu.d/win10/prepare/begin/bind_vfio.sh
owner: root
group: root
mode: '0744'
become: yes
# - name: bind_vfio.sh
# template:
# src: bind_vfio.sh.j2
# dest: /etc/libvirt/hooks/qemu.d/win10/prepare/begin/bind_vfio.sh
# owner: root
# group: root
# mode: '0744'
# become: yes
- name: unbind_vfio.sh
template:
src: unbind_vfio.sh.j2
dest: /etc/libvirt/hooks/qemu.d/win10/release/end/unbind_vfio.sh
owner: root
group: root
mode: '0744'
become: yes
# - name: unbind_vfio.sh
# template:
# src: unbind_vfio.sh.j2
# dest: /etc/libvirt/hooks/qemu.d/win10/release/end/unbind_vfio.sh
# owner: root
# group: root
# mode: '0744'
# become: yes

View file

@ -1,5 +1,5 @@
## Virsh devices
VIRSH_GPU_VIDEO=pci_0000_0c_00_0
VIRSH_GPU_AUDIO=pci_0000_0c_00_1
VIRSH_GPU_VIDEO=pci_0000_0b_00_0
VIRSH_GPU_AUDIO=pci_0000_0b_00_1
VIRSH_GPU_USB=pci_0000_43_00_3
VIRSH_GPU_SSD=pci_0000_41_00_0