User Tools

Site Tools


opentofu-terraform-provider-kvm

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:

  • AllowTcpForwarding no to AllowTcpForwarding yes
provider.tf
terraform {
    required_providers {
        libvirt = {
            source = "dmacvicar/libvirt"
            version = "0.7.1"
        }
    }
}
 
provider "libvirt" {
    uri   = "qemu+ssh://root@<IP_ADDRESS>/system?sshauth=privkey"
}
opentofu-terraform-provider-kvm.txt · Last modified: 2023/10/09 20:47 by admin