builder.vagrant: simplify communicator.Config field

This commit is contained in:
Adrien Delorme 2019-10-14 16:12:09 +02:00
parent 3fe1c96491
commit 6fbd664b66
1 changed files with 4 additions and 7 deletions

View File

@ -27,17 +27,14 @@ type Builder struct {
runner multistep.Runner
}
type SSHConfig struct {
Comm communicator.Config `mapstructure:",squash"`
}
type Config struct {
common.PackerConfig `mapstructure:",squash"`
common.HTTPConfig `mapstructure:",squash"`
common.ISOConfig `mapstructure:",squash"`
common.FloppyConfig `mapstructure:",squash"`
bootcommand.BootConfig `mapstructure:",squash"`
SSHConfig `mapstructure:",squash"`
Comm communicator.Config `mapstructure:",squash"`
// The directory to create that will contain your output box. We always
// create this directory and run from inside of it to prevent Vagrant init
// collisions. If unset, it will be set to packer- plus your buildname.
@ -281,9 +278,9 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
b.config.GlobalID,
},
&communicator.StepConnect{
Config: &b.config.SSHConfig.Comm,
Config: &b.config.Comm,
Host: CommHost(),
SSHConfig: b.config.SSHConfig.Comm.SSHConfigFunc(),
SSHConfig: b.config.Comm.SSHConfigFunc(),
},
new(common.StepProvision),
&StepPackage{