Add `insecure_connection` parameter
This commit is contained in:
parent
d12fbcb700
commit
b218d42895
|
@ -49,6 +49,7 @@ This builder uses native vSphere API, and creates virtual machines remotely.
|
|||
* `host` - vSphere host where target VM is created.
|
||||
* `ssh_username` - username in guest OS.
|
||||
* `ssh_password` - password in guest OS.
|
||||
* `insecure_connection` - do not validate server's TLS certificate. `false` by default.
|
||||
|
||||
### Optional
|
||||
Destination:
|
||||
|
|
|
@ -45,7 +45,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
|
|||
return nil, err
|
||||
}
|
||||
vcenter_url.User = url.UserPassword(b.config.Username, b.config.Password)
|
||||
client, err := govmomi.NewClient(ctx, vcenter_url,true)
|
||||
client, err := govmomi.NewClient(ctx, vcenter_url, b.config.InsecureConnection)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ const testBuilderAccBasic = `
|
|||
"vcenter_server": "vcenter.vsphere5.test",
|
||||
"username": "root",
|
||||
"password": "jetbrains",
|
||||
"insecure_connection": true,
|
||||
|
||||
"template": "basic",
|
||||
"vm_name": "test1",
|
||||
|
|
|
@ -16,10 +16,11 @@ type Config struct {
|
|||
common.PackerConfig `mapstructure:",squash"`
|
||||
|
||||
// Connection
|
||||
VCenterServer string `mapstructure:"vcenter_server"`
|
||||
Datacenter string `mapstructure:"datacenter"`
|
||||
Username string `mapstructure:"username"`
|
||||
Password string `mapstructure:"password"`
|
||||
VCenterServer string `mapstructure:"vcenter_server"`
|
||||
Datacenter string `mapstructure:"datacenter"`
|
||||
Username string `mapstructure:"username"`
|
||||
Password string `mapstructure:"password"`
|
||||
InsecureConnection bool `mapstructure:"insecure_connection"`
|
||||
|
||||
// Location
|
||||
Template string `mapstructure:"template"`
|
||||
|
|
Loading…
Reference in New Issue