-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
packer string templates not working -- doc issue? #12651
Comments
Hi @matthewsht thanks for sharing your example. No examples make it difficult for sure. I will label this as a bug for the docs. We can benefit from having an example or two. If you are interested in contributing to the docs please feel free to open a PR. That said, It looks like you are escaping the local.history_file_date local variable within the template sequence, using
Example run with bogus data
|
Adds an example of a string template being used. The example demonstrates how a template sequence can be used to embed the value of a variable into a string that can be used as script content. Ref: #12651 Signed-off-by: Ryan Johnson <[email protected]>
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. |
Community Note
Overview of the Issue
String templates are not really documented and therefore hard to use.
Based on https://developer.hashicorp.com/packer/docs/templates/hcl_templates/expressions#string-templates
I attempted to use the docs from templatefile but apply them to a heredoc string. (As implied by that linked).
It doesn't work. I apologize if this is known issue or documented elsewhere.
Any suggestions?
Reproduction Steps
I have the following:
A packer validate run yields:
Packer version
> packer version Packer v1.9.4
The text was updated successfully, but these errors were encountered: