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

boot_steps fail to expand {{ .HTTPIP }} and {{ .HTTPPort }} #109

Closed
jacob-carlborg opened this issue Nov 15, 2022 · 4 comments · Fixed by #112
Closed

boot_steps fail to expand {{ .HTTPIP }} and {{ .HTTPPort }} #109

jacob-carlborg opened this issue Nov 15, 2022 · 4 comments · Fixed by #112
Labels

Comments

@jacob-carlborg
Copy link
Contributor

Overview of the Issue

If {{ .HTTPIP }} or {{ .HTTPPort }} are used in boot_steps they will not be expanded. When Packer is supposed to type the IP address or port, it instead outputs <no value>.

Looks like I missed something when I implemented boot_steps in #103.

Reproduction Steps

Use {{ .HTTPIP }} or {{ .HTTPPort }} in boot_steps.

Plugin and Packer version

boot_steps was added in packer-plugin-qemu 1.0.7.

Simplified Packer Buildfile

Partial build file of NetBSD:

boot_steps = [
  ["a<enter><wait5>", "Installation messages in English"]
  ["a<enter><wait5>", "Keyboard type: unchanged"],
  ["e<enter><wait5>", "Utility menu"],
  ["a<enter><wait5>", "Run /bin/sh"],

  ["{{.HTTPIP}}:{{.HTTPPort}}"],
]
@lbajolet-hashicorp
Copy link
Contributor

Hi @jacob-carlborg,

Sorry I missed that one, I'm surprised it happens as it would be the interpolate.Render call that takes care of that, but based on your experience, it looks like something else's missing.

I'm also able to replicate the problem locally, so it does look like a bug to fix.

I'll investigate, once I figure out what's happening and I can submit a fix, we can release a new version of the plugin.

Thanks for signalling this to us!

@lbajolet-hashicorp
Copy link
Contributor

Well that was an easier fix than expected :)

We'll release v1.0.8 of the plugin, either today or Monday at the latest, you should have this fixed on the latest main if you want to spin a test @jacob-carlborg.

Thanks again for signalling this bug!

@jacob-carlborg
Copy link
Contributor Author

@lbajolet-hashicorp Awesome, thanks. I've been banging my head against the wall with this bug for a while now.

@jacob-carlborg
Copy link
Contributor Author

@lbajolet-hashicorp I've tried your fix and can confirm it's now working. Thanks again.

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

Successfully merging a pull request may close this issue.

2 participants