hashicorp / packer-plugin-vsphere

Packer plugin for VMware vSphere Builder
https://www.packer.io/docs/builders/vsphere
Mozilla Public License 2.0
93 stars 91 forks source link

Add support to set template name during post-processing #397

Closed MalikKillian closed 2 months ago

MalikKillian commented 3 months ago

Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Add a function for the vSphere Template Post-Processor to rename the template.

Use Case(s)

My organization has set a standard for any and all templates to begin with the name template-. At current, I would have to create an actual VM that starts with template- and then convert it as part of the normal process. Otherwise there's manual intervention involved and that's what we're trying to avoid.

Potential configuration

Example of what the configuration might look like:

source "null" "example" {
    communicator = "none"
}

build {
    sources = [
        "source.null.example"
    ]

    post-processors {
      post-processor "vsphere-template"{
          template_name       = "template-testsql203"
          host                = "vcenter.example.com"
          insecure            = false
          username            = "administrator@vsphere.local"
          password            = "VMw@re1!"
          datacenter          = "dc-01"
          folder              = "/templates/os/distro"
      }
    }
}

Potential References

tenthirtyam commented 3 months ago

I've picked this one up for review.