terraform-provider-libvirt
terraform-provider-libvirt copied to clipboard
cloud-init.iso is not properly regenerated when config file changes
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?