Terraform/OpenTofu: KVM Provider

To set up the KVM Provider some additional steps are required to be able to access KVM remotely via SSH.

Change values in /etc/ssh/sshd_config on the KVM host:

provider.tf
terraform {
    required_providers {
        libvirt = {
            source = "dmacvicar/libvirt"
            version = "0.7.1"
        }
    }
}
 
provider "libvirt" {
    uri   = "qemu+ssh://root@<IP_ADDRESS>/system?sshauth=privkey"
}