builder.aws: use SSHAgentAuth from Comm

This commit is contained in:
Adrien Delorme 2018-08-28 15:43:38 +02:00
parent ef08c441c9
commit 293c485372
5 changed files with 2 additions and 7 deletions

View File

@ -16,7 +16,6 @@ import (
type StepKeyPair struct {
Debug bool
Comm *communicator.Config
SSHAgentAuth bool
DebugKeyPath string
TemporaryKeyPairName string
@ -40,12 +39,12 @@ func (s *StepKeyPair) Run(_ context.Context, state multistep.StateBag) multistep
return multistep.ActionContinue
}
if s.SSHAgentAuth && s.Comm.SSHKeyPair == "" {
if s.Comm.SSHAgentAuth && s.Comm.SSHKeyPair == "" {
ui.Say("Using SSH Agent with key pair in Source AMI")
return multistep.ActionContinue
}
if s.SSHAgentAuth && s.Comm.SSHKeyPair != "" {
if s.Comm.SSHAgentAuth && s.Comm.SSHKeyPair != "" {
ui.Say(fmt.Sprintf("Using SSH Agent for existing key pair %s", s.Comm.SSHKeyPair))
state.Put("keyPair", s.Comm.SSHKeyPair)
return multistep.ActionContinue

View File

@ -181,7 +181,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepKeyPair{
Debug: b.config.PackerDebug,
Comm: &b.config.RunConfig.Comm,
SSHAgentAuth: b.config.Comm.SSHAgentAuth,
DebugKeyPath: fmt.Sprintf("ec2_%s.pem", b.config.PackerBuildName),
TemporaryKeyPairName: b.config.TemporaryKeyPairName,
},

View File

@ -198,7 +198,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepKeyPair{
Debug: b.config.PackerDebug,
Comm: &b.config.RunConfig.Comm,
SSHAgentAuth: b.config.Comm.SSHAgentAuth,
DebugKeyPath: fmt.Sprintf("ec2_%s.pem", b.config.PackerBuildName),
TemporaryKeyPairName: b.config.TemporaryKeyPairName,
},

View File

@ -173,7 +173,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepKeyPair{
Debug: b.config.PackerDebug,
Comm: &b.config.RunConfig.Comm,
SSHAgentAuth: b.config.Comm.SSHAgentAuth,
DebugKeyPath: fmt.Sprintf("ec2_%s.pem", b.config.PackerBuildName),
TemporaryKeyPairName: b.config.TemporaryKeyPairName,
},

View File

@ -259,7 +259,6 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&awscommon.StepKeyPair{
Debug: b.config.PackerDebug,
Comm: &b.config.RunConfig.Comm,
SSHAgentAuth: b.config.Comm.SSHAgentAuth,
DebugKeyPath: fmt.Sprintf("ec2_%s.pem", b.config.PackerBuildName),
TemporaryKeyPairName: b.config.TemporaryKeyPairName,
},