Skip to content

Add support to include tags information in data source outputs #804

Description

@9numbernine9

Code of Conduct

  • I have read and agree to the project's Code of Conduct.
  • Vote on this issue by adding a 👍 reaction to the original issue description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Hello!

I'm excited to see the work for tag support in data sources that was released as part of #196 . Now that it has been released, I have a feature request: would it be possible to include tag information on the outputs of the data sources?

In our use case, we have essentially a "chain" of Packer images that are being built: a 'base' template image gets built, then that template is consumed by other downstream images, and those images are further consumed by other images, etc. It would be very useful to be able to discover the tags on any of the original input images so that they could be propagated forward to the further downstream images. (Essentially, this would allow "inheritance" of tag information on a case-by-case basis.)

Use Case(s)

To allow the usage of tags that were retrieved from a data source when building an image with vsphere-clone (e.g.).

Potential Configuration

Something like the following, based on existing examples in the docs. (Note that this is probably not syntactically correct but I think it gets the point across.)

data "vsphere-content-library-item" "iso" {
  vcenter_server  = "vc01.example.com"
  username        = "administrator@vsphere.local"
  password        = "VMware1!"
  datacenter      = "dc-01"
  content_library = "lib01"
  name            = "linux-debian-13*-amd64"
  type            = "iso"
  tag {
    category = "environment"
    name     = "production"
  }
}

source "vsphere-clone" "example" {
  vcenter_server = "vc01.example.com"
  username       = "administrator@vsphere.local"
  password       = "VMware1!"
  host           = "esx01.example.com"
  iso_paths      = [data.vsphere-content-library-item.iso.path]

  dynamic "tag" {
    # Not currently possible - feature request here!
    for_each = data.vsphere-content-library-item.iso.tags

    content {
      category = tag.category
      name     = tag.name
    }
  }

 # Then my image can be further enhanced with my own tags here
  tag {
    category = "my-category"
    name      = "my-name"
  }
}

build {
  sources = ["source.vsphere-clone.example"]
}

References

No response

Activity

  1. changed the title [-]Feature request: include tags information in data source _outputs_[/-] [+]Add support to include tags information in data source outputs[/+] on Aug 4, 2026
  2. self-assigned this
    on Aug 4, 2026
  3. added this to the Backlog milestone on Aug 4, 2026
  4. tenthirtyam commented on Aug 4, 2026

    @tenthirtyam
    Collaborator

    Assigned and added to the backlog.

  5. modified the milestones: Backlog, v2.4.0 on Aug 12, 2026
  6. github-actions commented on Aug 17, 2026

    @github-actions

    This functionality has been released in v2.4.0 of the plugin.

    For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

  7. github-actions commented on Sep 17, 2026

    @github-actions

    I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

    If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

  8. locked as resolved and limited conversation to collaborators on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions