SSHBastionPrivateKey => SSHBastionPrivateKeyFile
This commit is contained in:
parent
25de7ad1f2
commit
69dfe2565b
|
@ -41,7 +41,7 @@ type Config struct {
|
||||||
SSHBastionAgentAuth bool `mapstructure:"ssh_bastion_agent_auth"`
|
SSHBastionAgentAuth bool `mapstructure:"ssh_bastion_agent_auth"`
|
||||||
SSHBastionUsername string `mapstructure:"ssh_bastion_username"`
|
SSHBastionUsername string `mapstructure:"ssh_bastion_username"`
|
||||||
SSHBastionPassword string `mapstructure:"ssh_bastion_password"`
|
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"`
|
SSHFileTransferMethod string `mapstructure:"ssh_file_transfer_method"`
|
||||||
SSHProxyHost string `mapstructure:"ssh_proxy_host"`
|
SSHProxyHost string `mapstructure:"ssh_proxy_host"`
|
||||||
SSHProxyPort int `mapstructure:"ssh_proxy_port"`
|
SSHProxyPort int `mapstructure:"ssh_proxy_port"`
|
||||||
|
@ -217,8 +217,8 @@ func (c *Config) prepareSSH(ctx *interpolate.Context) []error {
|
||||||
c.SSHBastionPort = 22
|
c.SSHBastionPort = 22
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.SSHBastionPrivateKey == "" && c.SSHPrivateKeyFile != "" {
|
if c.SSHBastionPrivateKeyFile == "" && c.SSHPrivateKeyFile != "" {
|
||||||
c.SSHBastionPrivateKey = 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.SSHBastionHost != "" && !c.SSHBastionAgentAuth {
|
||||||
if c.SSHBastionPassword == "" && c.SSHBastionPrivateKey == "" {
|
if c.SSHBastionPassword == "" && c.SSHBastionPrivateKeyFile == "" {
|
||||||
errs = append(errs, errors.New(
|
errs = append(errs, errors.New(
|
||||||
"ssh_bastion_password or ssh_bastion_private_key_file must be specified"))
|
"ssh_bastion_password or ssh_bastion_private_key_file must be specified"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,8 +225,8 @@ func sshBastionConfig(config *Config) (*gossh.ClientConfig, error) {
|
||||||
ssh.PasswordKeyboardInteractive(config.SSHBastionPassword)))
|
ssh.PasswordKeyboardInteractive(config.SSHBastionPassword)))
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.SSHBastionPrivateKey != "" {
|
if config.SSHBastionPrivateKeyFile != "" {
|
||||||
signer, err := helperssh.FileSigner(config.SSHBastionPrivateKey)
|
signer, err := helperssh.FileSigner(config.SSHBastionPrivateKeyFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue