make virtualbox, hyperv, openstack, and parallels builders respect winrm_host by correctly passing communicator config Host() func to commhost instead of just SSHHost
This commit is contained in:
parent
9944031580
commit
e8b3a0e3bf
|
@ -294,7 +294,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
|
||||||
// configure the communicator ssh, winrm
|
// configure the communicator ssh, winrm
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.SSHConfig.Comm,
|
Config: &b.config.SSHConfig.Comm,
|
||||||
Host: hypervcommon.CommHost(b.config.SSHConfig.Comm.SSHHost),
|
Host: hypervcommon.CommHost(b.config.SSHConfig.Comm.Host()),
|
||||||
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -334,7 +334,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
|
||||||
// configure the communicator ssh, winrm
|
// configure the communicator ssh, winrm
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.SSHConfig.Comm,
|
Config: &b.config.SSHConfig.Comm,
|
||||||
Host: hypervcommon.CommHost(b.config.SSHConfig.Comm.SSHHost),
|
Host: hypervcommon.CommHost(b.config.SSHConfig.Comm.Host()),
|
||||||
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.RunConfig.Comm,
|
Config: &b.config.RunConfig.Comm,
|
||||||
Host: CommHost(
|
Host: CommHost(
|
||||||
b.config.RunConfig.Comm.SSHHost,
|
b.config.RunConfig.Comm.Host(),
|
||||||
computeClient,
|
computeClient,
|
||||||
b.config.SSHInterface,
|
b.config.SSHInterface,
|
||||||
b.config.SSHIPVersion),
|
b.config.SSHIPVersion),
|
||||||
|
|
|
@ -238,7 +238,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
|
||||||
},
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.SSHConfig.Comm,
|
Config: &b.config.SSHConfig.Comm,
|
||||||
Host: parallelscommon.CommHost(b.config.SSHConfig.Comm.SSHHost),
|
Host: parallelscommon.CommHost(b.config.SSHConfig.Comm.Host()),
|
||||||
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
¶llelscommon.StepUploadVersion{
|
¶llelscommon.StepUploadVersion{
|
||||||
|
|
|
@ -87,7 +87,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
|
||||||
},
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.SSHConfig.Comm,
|
Config: &b.config.SSHConfig.Comm,
|
||||||
Host: parallelscommon.CommHost(b.config.SSHConfig.Comm.SSHHost),
|
Host: parallelscommon.CommHost(b.config.SSHConfig.Comm.Host()),
|
||||||
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
¶llelscommon.StepUploadVersion{
|
¶llelscommon.StepUploadVersion{
|
||||||
|
|
|
@ -48,6 +48,7 @@ func (c *CommConfig) Prepare(ctx *interpolate.Context) (warnings []string, errs
|
||||||
|
|
||||||
if c.Comm.SSHHost == "" && c.SkipNatMapping {
|
if c.Comm.SSHHost == "" && c.SkipNatMapping {
|
||||||
c.Comm.SSHHost = "127.0.0.1"
|
c.Comm.SSHHost = "127.0.0.1"
|
||||||
|
c.Comm.WinRMHost = "127.0.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.HostPortMin == 0 {
|
if c.HostPortMin == 0 {
|
||||||
|
|
|
@ -50,8 +50,9 @@ func (c *CommConfig) Prepare(ctx *interpolate.Context) []error {
|
||||||
c.SkipNatMapping = c.SSHSkipNatMapping
|
c.SkipNatMapping = c.SSHSkipNatMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.Comm.SSHHost == "" {
|
if c.Comm.Host() == "" {
|
||||||
c.Comm.SSHHost = "127.0.0.1"
|
c.Comm.SSHHost = "127.0.0.1"
|
||||||
|
c.Comm.WinRMHost = "127.0.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.HostPortMin == 0 {
|
if c.HostPortMin == 0 {
|
||||||
|
|
|
@ -449,7 +449,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
|
||||||
},
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.CommConfig.Comm,
|
Config: &b.config.CommConfig.Comm,
|
||||||
Host: vboxcommon.CommHost(b.config.CommConfig.Comm.SSHHost),
|
Host: vboxcommon.CommHost(b.config.CommConfig.Comm.Host()),
|
||||||
SSHConfig: b.config.CommConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.CommConfig.Comm.SSHConfigFunc(),
|
||||||
SSHPort: vboxcommon.CommPort,
|
SSHPort: vboxcommon.CommPort,
|
||||||
WinRMPort: vboxcommon.CommPort,
|
WinRMPort: vboxcommon.CommPort,
|
||||||
|
|
|
@ -130,7 +130,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
|
||||||
},
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.CommConfig.Comm,
|
Config: &b.config.CommConfig.Comm,
|
||||||
Host: vboxcommon.CommHost(b.config.CommConfig.Comm.SSHHost),
|
Host: vboxcommon.CommHost(b.config.CommConfig.Comm.Host()),
|
||||||
SSHConfig: b.config.CommConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.CommConfig.Comm.SSHConfigFunc(),
|
||||||
SSHPort: vboxcommon.CommPort,
|
SSHPort: vboxcommon.CommPort,
|
||||||
WinRMPort: vboxcommon.CommPort,
|
WinRMPort: vboxcommon.CommPort,
|
||||||
|
|
|
@ -114,7 +114,7 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
|
||||||
},
|
},
|
||||||
&communicator.StepConnect{
|
&communicator.StepConnect{
|
||||||
Config: &b.config.CommConfig.Comm,
|
Config: &b.config.CommConfig.Comm,
|
||||||
Host: vboxcommon.CommHost(b.config.CommConfig.Comm.SSHHost),
|
Host: vboxcommon.CommHost(b.config.CommConfig.Comm.Host()),
|
||||||
SSHConfig: b.config.CommConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.CommConfig.Comm.SSHConfigFunc(),
|
||||||
SSHPort: vboxcommon.CommPort,
|
SSHPort: vboxcommon.CommPort,
|
||||||
WinRMPort: vboxcommon.CommPort,
|
WinRMPort: vboxcommon.CommPort,
|
||||||
|
|
Loading…
Reference in New Issue