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

25 lines
537 B
Go
Raw Normal View History

2019-06-20 08:59:30 -04:00
//go:generate struct-markdown
2013-12-24 01:27:01 -05:00
package common
import (
2017-04-04 16:39:01 -04:00
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/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
}