rkoosaar / terraform-proxmox-vm

Terraform module for creating and managing VM Qemu resources
MIT License
14 stars 5 forks source link

Error: Invalid template interpolation value #6

Closed hbokh closed 3 years ago

hbokh commented 3 years ago

Hi! I've been playing around a bit with your module.

How do I get beyond this error?

$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

------------------------------------------------------------------------

Error: Invalid template interpolation value

  on .terraform/modules/vm/main.tf line 114, in resource "proxmox_vm_qemu" "vm_qemu":
 113:   sshkeys = <<EOF
 114:     ${var.sshkeys}
 115:     EOF
    |----------------
    | var.sshkeys is null

The expression result is null. Cannot include a null value in a string
template.

Or please document where / how to set sshkeys, if not only needed for the cloud-init specific block. Thanks!

rkoosaar commented 3 years ago

@hbokh Apologies for not getting back to you sooner. I just noticed this. Are you still having issues with this?

In my module I have set it like this:

module "prx_vm" {
  source = "../../modules/terraform-proxmox-vm"

 ... Stuff goes here 

  sshkeys      = "ssh-ed25519 AAAAC3NzaC1l7faf6a69UIATUDABIBTrVBGFSDAGLRJ+JjqB0+bgaKW80W6bxv407PzS user@domain.name"
}
hbokh commented 3 years ago

Thanks. Haven't look at this since Nov. 22nd 2020. Will try the above configuration if I ever get to it again.