Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple cardinality for tagging a virtual machine #159

Open
RDG88 opened this issue Feb 14, 2024 · 1 comment
Open

Support for multiple cardinality for tagging a virtual machine #159

RDG88 opened this issue Feb 14, 2024 · 1 comment

Comments

@RDG88
Copy link

RDG88 commented Feb 14, 2024

I'm attempting to assign multiple tags within the same category to a virtual machine but encountering an issue where only one tag is successfully added. Here's how I've structured the tags:

i defined the tags like this:

tags = {
    "cat-ansible" = "ssh_key"
    "cat-ansible" = "update_round_1"
  }

It seems that only one tag specified is being applied.

@Hello-User
Copy link

I ran into the same issue. A workaround I settled for is just importing the vsphere tag manually,

data "vsphere_tag_category" "iac" {
  provider      = vsphere
  name = "IaC"
}

data "vsphere_tag" "terraform" {
  provider      = vsphere
  name = "Terraform"
  category_id = data.vsphere_tag_category.iac.id
}

data "vsphere_tag" "ansible" {
  provider      = vsphere
  name = "Ansible"
  category_id = data.vsphere_tag_category.iac.id
}

And defining tag_ids in my vm declaration.
tag_ids = [ data.vsphere_tag.ansible.id, data.vsphere_tag.terraform.id ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants