fix ssh interface conflict
This commit is contained in:
parent
1424f1b564
commit
e10b9fb708
|
@ -164,7 +164,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
Config: &b.config.RunConfig.Comm,
|
Config: &b.config.RunConfig.Comm,
|
||||||
Host: osccommon.SSHHost(
|
Host: osccommon.SSHHost(
|
||||||
oapiconn,
|
oapiconn,
|
||||||
b.config.Comm.SSHInterface),
|
b.config.SSHInterface),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&common.StepProvision{},
|
||||||
|
|
|
@ -187,7 +187,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
Config: &b.config.RunConfig.Comm,
|
Config: &b.config.RunConfig.Comm,
|
||||||
Host: osccommon.SSHHost(
|
Host: osccommon.SSHHost(
|
||||||
oapiconn,
|
oapiconn,
|
||||||
b.config.Comm.SSHInterface),
|
b.config.SSHInterface),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&common.StepProvision{},
|
||||||
|
|
|
@ -165,7 +165,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
|
||||||
Config: &b.config.RunConfig.Comm,
|
Config: &b.config.RunConfig.Comm,
|
||||||
Host: osccommon.SSHHost(
|
Host: osccommon.SSHHost(
|
||||||
oapiconn,
|
oapiconn,
|
||||||
b.config.Comm.SSHInterface),
|
b.config.SSHInterface),
|
||||||
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
SSHConfig: b.config.RunConfig.Comm.SSHConfigFunc(),
|
||||||
},
|
},
|
||||||
&common.StepProvision{},
|
&common.StepProvision{},
|
||||||
|
|
|
@ -88,6 +88,7 @@ type RunConfig struct {
|
||||||
|
|
||||||
// Communicator settings
|
// Communicator settings
|
||||||
Comm communicator.Config `mapstructure:",squash"`
|
Comm communicator.Config `mapstructure:",squash"`
|
||||||
|
SSHInterface string `mapstructure:"ssh_interface"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {
|
func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {
|
||||||
|
@ -113,12 +114,12 @@ func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {
|
||||||
errs := c.Comm.Prepare(ctx)
|
errs := c.Comm.Prepare(ctx)
|
||||||
|
|
||||||
// Validating ssh_interface
|
// Validating ssh_interface
|
||||||
if c.Comm.SSHInterface != "public_ip" &&
|
if c.SSHInterface != "public_ip" &&
|
||||||
c.Comm.SSHInterface != "private_ip" &&
|
c.SSHInterface != "private_ip" &&
|
||||||
c.Comm.SSHInterface != "public_dns" &&
|
c.SSHInterface != "public_dns" &&
|
||||||
c.Comm.SSHInterface != "private_dns" &&
|
c.SSHInterface != "private_dns" &&
|
||||||
c.Comm.SSHInterface != "" {
|
c.SSHInterface != "" {
|
||||||
errs = append(errs, fmt.Errorf("Unknown interface type: %s", c.Comm.SSHInterface))
|
errs = append(errs, fmt.Errorf("Unknown interface type: %s", c.SSHInterface))
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.Comm.SSHKeyPairName != "" {
|
if c.Comm.SSHKeyPairName != "" {
|
||||||
|
|
Loading…
Reference in New Issue