From 69dfe2565b425340ba3ea04fe64558d14b07cf9e Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 27 Aug 2018 16:33:30 +0200 Subject: [PATCH] SSHBastionPrivateKey => SSHBastionPrivateKeyFile --- helper/communicator/config.go | 8 ++++---- helper/communicator/step_connect_ssh.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/helper/communicator/config.go b/helper/communicator/config.go index 990e915f2..7e8c06ccf 100644 --- a/helper/communicator/config.go +++ b/helper/communicator/config.go @@ -41,7 +41,7 @@ type Config struct { SSHBastionAgentAuth bool `mapstructure:"ssh_bastion_agent_auth"` SSHBastionUsername string `mapstructure:"ssh_bastion_username"` SSHBastionPassword string `mapstructure:"ssh_bastion_password"` - SSHBastionPrivateKey string `mapstructure:"ssh_bastion_private_key_file"` + SSHBastionPrivateKeyFile string `mapstructure:"ssh_bastion_private_key_file"` SSHFileTransferMethod string `mapstructure:"ssh_file_transfer_method"` SSHProxyHost string `mapstructure:"ssh_proxy_host"` SSHProxyPort int `mapstructure:"ssh_proxy_port"` @@ -217,8 +217,8 @@ func (c *Config) prepareSSH(ctx *interpolate.Context) []error { c.SSHBastionPort = 22 } - if c.SSHBastionPrivateKey == "" && c.SSHPrivateKeyFile != "" { - c.SSHBastionPrivateKey = c.SSHPrivateKeyFile + if c.SSHBastionPrivateKeyFile == "" && c.SSHPrivateKeyFile != "" { + c.SSHBastionPrivateKeyFile = c.SSHPrivateKeyFile } } @@ -249,7 +249,7 @@ func (c *Config) prepareSSH(ctx *interpolate.Context) []error { } if c.SSHBastionHost != "" && !c.SSHBastionAgentAuth { - if c.SSHBastionPassword == "" && c.SSHBastionPrivateKey == "" { + if c.SSHBastionPassword == "" && c.SSHBastionPrivateKeyFile == "" { errs = append(errs, errors.New( "ssh_bastion_password or ssh_bastion_private_key_file must be specified")) } diff --git a/helper/communicator/step_connect_ssh.go b/helper/communicator/step_connect_ssh.go index c0c2935e7..6bdbcffae 100644 --- a/helper/communicator/step_connect_ssh.go +++ b/helper/communicator/step_connect_ssh.go @@ -225,8 +225,8 @@ func sshBastionConfig(config *Config) (*gossh.ClientConfig, error) { ssh.PasswordKeyboardInteractive(config.SSHBastionPassword))) } - if config.SSHBastionPrivateKey != "" { - signer, err := helperssh.FileSigner(config.SSHBastionPrivateKey) + if config.SSHBastionPrivateKeyFile != "" { + signer, err := helperssh.FileSigner(config.SSHBastionPrivateKeyFile) if err != nil { return nil, err }