packer-cn/builder/vmware/common/ssh_config.go

25 lines
537 B
Go
Raw Normal View History

2019-06-20 14:59:30 +02:00
//go:generate struct-markdown
2013-12-23 23:27:01 -07:00
package common
import (
2017-04-04 13:39:01 -07:00
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/template/interpolate"
2013-12-23 23:27:01 -07:00
)
type SSHConfig struct {
2015-06-13 18:52:44 -04:00
Comm communicator.Config `mapstructure:",squash"`
2013-12-23 23:27:01 -07: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 14:59:30 +02:00
SSHSkipRequestPty bool `mapstructure:"ssh_skip_request_pty"`
2013-12-23 23:27:01 -07:00
}
2015-05-27 14:16:28 -07: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-23 23:27:01 -07:00
}
2015-06-13 18:52:44 -04:00
return c.Comm.Prepare(ctx)
2013-12-23 23:27:01 -07:00
}