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

Add http_content func to serve variables from HTTP @ preseed #10801

Merged
merged 15 commits into from
Mar 23, 2021
Merged

Conversation

azr
Copy link
Contributor

@azr azr commented Mar 22, 2021

This imports hashicorp/packer-plugin-sdk#43

  • code generate things
  • update docs
  • update guides
  • update examples

This helps with #9485

@azr azr requested review from carlpett, taliesins and a team as code owners March 22, 2021 14:12
@azr azr marked this pull request as draft March 22, 2021 14:12
@azr azr changed the title Azr http content Add http_content func to serve variables from HTTP @ preseed Mar 22, 2021
@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #10801 (098ca11) into master (8c61ca1) will increase coverage by 0.02%.
The diff coverage is 14.28%.

❗ Current head 098ca11 differs from pull request most recent head f37fab0. Consider uploading reports for the commit f37fab0 to get more accurate results

Impacted Files Coverage Δ
builder/cloudstack/builder.go 7.31% <0.00%> (+0.42%) ⬆️
builder/hyperv/iso/builder.go 27.31% <0.00%> (+0.65%) ⬆️
builder/hyperv/vmcx/builder.go 19.57% <0.00%> (+0.34%) ⬆️
builder/parallels/iso/builder.go 39.67% <0.00%> (+1.04%) ⬆️
builder/proxmox/common/builder.go 0.00% <0.00%> (ø)
builder/qemu/builder.go 0.00% <0.00%> (ø)
builder/virtualbox/iso/builder.go 37.20% <0.00%> (+0.60%) ⬆️
builder/virtualbox/ovf/builder.go 0.00% <0.00%> (ø)
builder/vmware/iso/builder.go 3.33% <0.00%> (+0.09%) ⬆️
builder/vmware/vmx/builder.go 3.52% <0.00%> (+0.10%) ⬆️
... and 4 more

@@ -1158,6 +1158,7 @@ var PASSTHROUGHS = map[string]string{"NVME_Present": "{{ .NVME_Present }}",
"WinRMPassword": "{{ .WinRMPassword }}",
"DefaultOrganizationID": "{{ .DefaultOrganizationID }}",
"HTTPDir": "{{ .HTTPDir }}",
"HTTPContent": "{{ .HTTPContent }}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this one was necessary but since HTTPDir is there, I'm putting it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better be safe!

paste auto generated docs 🤷‍♂️
@azr azr marked this pull request as ready for review March 22, 2021 15:10
Copy link
Contributor

@sylviamoss sylviamoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼
Tested with virtualbox-iso building an alpine image and it worked!

@azr azr merged commit 7732f79 into master Mar 23, 2021
@azr azr deleted the azr_http_content branch March 23, 2021 11:31
@sylviamoss sylviamoss added core Core components of Packer enhancement labels Mar 29, 2021
@ekristen
Copy link

Is this in a released version yet? Documentation doesn't seem to be live? Trying this with 1.7.2 locally doesn't seem to work?

@ekristen
Copy link

For anyone that gets here -- you have to add a front slash to your files, or things will not work.

http_content = {
  "a/b" = "content
}

^^^ this will not work!

http_content = {
  "/a/b" = "content
}

This will.

@azr
Copy link
Contributor Author

azr commented Apr 20, 2021

Hello there, thanks for adding this, a blog post is coming up ! I got tricked by the first slash a few times myself.

@ghost
Copy link

ghost commented Apr 23, 2021

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.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core Core components of Packer enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants