|
|
|
|
@ -2,7 +2,9 @@ package vagrant
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"log"
|
|
|
|
|
"strconv"
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/packer/helper/multistep"
|
|
|
|
|
)
|
|
|
|
|
@ -53,6 +55,15 @@ func (s *StepSSHConfig) Run(ctx context.Context, state multistep.StateBag) multi
|
|
|
|
|
// auth provided there.
|
|
|
|
|
return multistep.ActionContinue
|
|
|
|
|
}
|
|
|
|
|
log.Printf("identity file is %s", sshConfig.IdentityFile)
|
|
|
|
|
log.Printf("Removing quotes from identity file")
|
|
|
|
|
if strings.HasPrefix(sshConfig.IdentityFile, "\"") {
|
|
|
|
|
sshConfig.IdentityFile = sshConfig.IdentityFile[1:]
|
|
|
|
|
if strings.HasSuffix(sshConfig.IdentityFile, "\"") {
|
|
|
|
|
sshConfig.IdentityFile = sshConfig.IdentityFile[:len(sshConfig.IdentityFile)-1]
|
|
|
|
|
}
|
|
|
|
|
log.Printf("identity file is now %s", sshConfig.IdentityFile)
|
|
|
|
|
}
|
|
|
|
|
config.Comm.SSHPrivateKeyFile = sshConfig.IdentityFile
|
|
|
|
|
config.Comm.SSHUsername = sshConfig.User
|
|
|
|
|
|
|
|
|
|
|