Adds the option to allow ovftool to use --noSSLVerify if insecure is set to false.
Adds an error, similar to incorrect credentials error, message if the ovftool's target endpoint's SSL thumbprint is not trusted by the Packer host and suggests remediation options.
Updates error, log, ui, and fatal messages.
Testing
Build
packer-plugin-vsphere1 on ๎ fix/ovftool-error-handling- [?] via ๐น v1.22.2
โ make generate
2024/04/25 09:52:13 Copying "docs" to ".docs/"
2024/04/25 09:52:13 Replacing @include '...' calls in .docs/
Compiling MDX docs in '.docs' to Markdown in '.web-docs'...
packer-plugin-vsphere1 on ๎ fix/ovftool-error-handling- [?] via ๐น v1.22.2 took 13.5s
โ make build
packer-plugin-vsphere1 on ๎ fix/ovftool-error-handling- [?] via ๐น v1.22.2 took 5.0s
โ make test
? github.com/hashicorp/packer-plugin-vsphere [no test files]
? github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/testing [no test files]
? github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/examples/driver [no test files]
? github.com/hashicorp/packer-plugin-vsphere/version [no test files]
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone 1.513s
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common 2.485s
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver 5.813s
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso 2.259s
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/supervisor 4.454s
ok github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere 1.739s
ok github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template 2.764s
Run
If insecure is not provided or is set to false explicitly for the post-processor and the certificate is not trusted, it will fail with an error by capturing "Accept SSL fingerprint" in the stdout. Unfortunately, I'm unable to get it to pause and allow for user input with a fmt.Scanln(&response). (I've tried endlessly to get that to work.ยฏ\_(ใ)_/ยฏ )
If insecure is set to true, it will proceed and present a message.
=> vsphere-iso.linux-photon: Running post-processor: (type vsphere)
vsphere-iso.linux-photon (vsphere): Uploading /Users/ryan/Library/Mobile Documents/com~apple~CloudDocs/Code/Personal/<sensitive>-examples-for-vsphere12/artifacts/linux-photon-5.0-develop/linux-photon-5.0-develop.ovf to m01-vc01.rainpole.io
vsphere-iso.linux-photon (vsphere): Validating username and password...
vsphere-iso.linux-photon (vsphere): Skipping SSL thumbprint verification; insecure flag set to true...
vsphere-iso.linux-photon (vsphere): Uploading virtual machine...
vsphere-iso.linux-photon (vsphere): Opening OVF source: /Users/ryan/Library/Mobile Documents/com~apple~CloudDocs/Code/Personal/<sensitive>-examples-for-vsphere12/artifacts/linux-photon-5.0-develop/linux-photon-5.0-develop.ovf
vsphere-iso.linux-photon (vsphere): The manifest validates
Summary
--noSSLVerify
if insecure is set tofalse
.Testing
Build
Run
If
insecure
is not provided or is set tofalse
explicitly for the post-processor and the certificate is not trusted, it will fail with an error by capturing "Accept SSL fingerprint" in the stdout. Unfortunately, I'm unable to get it to pause and allow for user input with afmt.Scanln(&response)
. (I've tried endlessly to get that to work.ยฏ\_(ใ)_/ยฏ
)If
insecure
is set totrue
, it will proceed and present a message.Reference
Closes #297