2019-06-20 08:59:30 -04:00
|
|
|
//go:generate struct-markdown
|
|
|
|
|
2013-12-24 01:27:01 -05:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
2020-12-17 16:29:25 -05:00
|
|
|
"github.com/hashicorp/packer-plugin-sdk/communicator"
|
|
|
|
"github.com/hashicorp/packer-plugin-sdk/template/interpolate"
|
2013-12-24 01:27:01 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type SSHConfig struct {
|
2015-06-13 18:52:44 -04:00
|
|
|
Comm communicator.Config `mapstructure:",squash"`
|
2013-12-24 01:27:01 -05:00
|
|
|
|
2015-06-13 18:52:44 -04:00
|
|
|
// These are deprecated, but we keep them around for BC
|
|
|
|
// TODO(@mitchellh): remove
|
2019-06-20 08:59:30 -04:00
|
|
|
SSHSkipRequestPty bool `mapstructure:"ssh_skip_request_pty"`
|
2013-12-24 01:27:01 -05:00
|
|
|
}
|
|
|
|
|
2015-05-27 17:16:28 -04:00
|
|
|
func (c *SSHConfig) Prepare(ctx *interpolate.Context) []error {
|
2015-06-13 18:52:44 -04:00
|
|
|
if c.SSHSkipRequestPty {
|
|
|
|
c.Comm.SSHPty = false
|
2013-12-24 01:27:01 -05:00
|
|
|
}
|
|
|
|
|
2015-06-13 18:52:44 -04:00
|
|
|
return c.Comm.Prepare(ctx)
|
2013-12-24 01:27:01 -05:00
|
|
|
}
|