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

Templating for floppy_files and cd_files #11210

Closed
ekristen opened this issue Aug 16, 2021 · 8 comments
Closed

Templating for floppy_files and cd_files #11210

ekristen opened this issue Aug 16, 2021 · 8 comments

Comments

@ekristen
Copy link

ekristen commented Aug 16, 2021

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

Please add templating for floppy_files and cd_files, or add an additional option to provide templated files using templatefile

This is being opened because #4530 was closed.

Use Case(s)

The only way to provide windows with an Autounattend.xml is via floppy/usb/cd and there are a number of reasons why the Autounattend.xml needs to be a template.

I'm sure there are other use cases where floppy/usb/cd files need to be templated.

Potential configuration

template_floppy_files = {
  "Autounattend.xml": templatefile("${path.root}/templates/Autunattend.xml", { product_key = var.product_key })
}

Potential References

@puetzk
Copy link
Contributor

puetzk commented Aug 16, 2021

FYI: this is possible using http_content since hashicorp/packer-plugin-sdk#43, and cd_content since hashicorp/packer-plugin-sdk#61. So I think it's just floppies that still don't have a way.

@ekristen
Copy link
Author

Oh interesting. I missed that about cd content. I knew http had it, so if floppy could get it we'd be set.

@azr azr self-assigned this Sep 8, 2021
@frippe75
Copy link

This is a much needed enhancement! At the moment doing search'n'replace to do this. But running Packer containerized pull from a git repo makes this cumbersome. Templating in general should be support even for scripts using cd_files. But that's another thread.

@azr
Copy link
Contributor

azr commented Oct 21, 2021

Hey @frippe75 ! cd_content is here, and floppy_content almost (depending on which plugin you use). The SDK has been updated and plugins needs to add support for it. It has landed for vsphere. Please consider contributing if you are in a rush :).

@bendem
Copy link

bendem commented Oct 26, 2021

This is the same as #10859 btw.

@tenthirtyam
Copy link
Contributor

Works wonderfully for the vSphere plugin for http_content, cd_content, and floppy_content. Used heavily in https://github.com/vmware-samples/packer-examples-for-vsphere.

@azr - it seems to me that this issue should be closed and that the support for templates is dependent on the plugin - and that issues should be raised at the plugin's project repo instead.

Ryan Johnson
Senior Staff Solutions Architect | Product Engineering @ VMware, Inc.

@nywilken
Copy link
Contributor

Closing as this has been fixed in the latest release for the vSphere Packer plugin. For other plugins that don't have this functionality please open an enhancement request on plugin issue tracker.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants