Terraform-VMWare-Modules / terraform-vsphere-vm

Terraform vSphere module for provisioning Virtual Machines
https://registry.terraform.io/modules/Terraform-VMWare-Modules/vm/vsphere/
MIT License
169 stars 176 forks source link

multiple tags for the same category #137

Closed lotusnoir closed 2 years ago

lotusnoir commented 2 years ago

Hello In Vcenter i configured multiple tags for same category "applications" So a vm can have a tag like docker / nginx / etc..

When i use the tags variables on module it doesnt show them all but just take the last one on the common category

tags = {
"applications" = "docker"
"applications" = "nginx"
"test" = "test1"
}

vsphere will just keep "nginx" and "test1" but ignore "docker" how can i have multiple tags of same categories ? Thanks in advance

lotusnoir commented 2 years ago

if i try to set a list

  tags = {
    "test" = [ "test1", "test2" ]
  }

i get this error:

│ Error: Incorrect attribute value type
│ 
│   on ../modules/vm/vsphere/main.tf line 62, in data "vsphere_tag" "tag":
│   62:   name        = var.tags[keys(var.tags)[count.index]]
│     ├────────────────
│     │ count.index is 1
│     │ var.tags is map of list of string with 2 elements
│ 
│ Inappropriate value for attribute "name": string required.
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

enable

lotusnoir commented 2 years ago

i'm still trying to change the configuration but i dont make it work... help could be very welcome...