terraform-provider-libvirt icon indicating copy to clipboard operation
terraform-provider-libvirt copied to clipboard

cloud-init.iso is not properly regenerated when config file changes

Open Time0o opened this issue 8 months ago • 1 comments

I am not super familiar with how terraform works but this can't be right, I have the following in my terraform config:

resource "libvirt_cloudinit_disk" "k8s_init" {                                      
  name = "cloud-init.iso"                                                           
  pool = var.remote_libvirt_storage_pool                                            
  user_data = templatefile("${path.module}/cloud-init/k8s.yaml", {                  
    k8s_user                = "k8s"                                                 
    k8s_user_ssh_public_key = "${var.k8s_vm_ssh_public_key}.pub"                    
  })                                                                                
} 

This worked initially but then I changed the public key passed to k8s.yaml which then results in:

error creating libvirt volume for cloudinit device cloud-init.iso: storage volume 'cloud-init.iso' exists already

That is of course fixable by just deleting this storage volume but isn't the whole point of terraform that I DON'T have to do things like that manually?

Time0o avatar Feb 12 '25 09:02 Time0o