# Role: libvirt

## Description

Installs and configures libvirt.

Comes with helper scripts for taking VM snapshots and adding a GPU passthrough to a VM.

https://libvirt.org/

## Usage

Using in a playbook:

```yaml
- name: Play
  gather_facts: true
  gather_subset:
    - distribution
  hosts:
    - all
  roles:
    - samuliy.ansible.libvirt
  vars:
    ...
```

### Vars

`libvirt_vm_vfio_passthrough_begin_stop_services`:

Services to stop before VFIO passthrough.

`libvirt_vm_vfio_passthrough_end_start_services`:

Services to start after VFIO passthrough.

`libvirt_vm_vfio_passthrough_pci_devices`:

PCI devices to use for VFIO passthrough.

`libvirt_vm_vfio_passthrough_disable_kernel_modules`:

Kernel modules to disable for VFIO passthrough.

`libvirt_vm_vfio_passthrough_domains`:

Domains that use VFIO passthrough.

`libvirt_memlock`:

Memlock value for VMs.
