Documentation ¶
Index ¶
- Constants
- func BastionConnectFunc(bProto string, bAddr string, bConf *ssh.ClientConfig, proto string, ...) func() (net.Conn, error)
- func ConnectFunc(network, addr string) func() (net.Conn, error)
- func PasswordKeyboardInteractive(password string) ssh.KeyboardInteractiveChallenge
- type Communicator
- func (c *Communicator) Connect(o provisioners.UIOutput) (err error)
- func (c *Communicator) Disconnect() error
- func (c *Communicator) ScriptPath() string
- func (c *Communicator) Start(cmd *remote.Cmd) error
- func (c *Communicator) Timeout() time.Duration
- func (c *Communicator) Upload(path string, input io.Reader) error
- func (c *Communicator) UploadDir(dst string, src string) error
- func (c *Communicator) UploadScript(path string, input io.Reader) error
Constants ¶
const ( // DefaultUser is used if there is no user given DefaultUser = "root" // DefaultPort is used if there is no port given DefaultPort = 22 // DefaultUnixScriptPath is used as the path to copy the file to // for remote execution on unix if not provided otherwise. DefaultUnixScriptPath = "/tmp/terraform_%RAND%.sh" // DefaultWindowsScriptPath is used as the path to copy the file to // for remote execution on windows if not provided otherwise. DefaultWindowsScriptPath = "C:/windows/temp/terraform_%RAND%.cmd" // DefaultTimeout is used if there is no timeout given DefaultTimeout = 5 * time.Minute // TargetPlatformUnix used for cleaner code, and is used if no target platform has been specified TargetPlatformUnix = "unix" //TargetPlatformWindows used for cleaner code TargetPlatformWindows = "windows" )
const (
// DefaultShebang is added at the top of a SSH script file
DefaultShebang = "#!/bin/sh\n"
)
Variables ¶
This section is empty.
Functions ¶
func BastionConnectFunc ¶
func BastionConnectFunc( bProto string, bAddr string, bConf *ssh.ClientConfig, proto string, addr string) func() (net.Conn, error)
BastionConnectFunc is a convenience method for returning a function that connects to a host over a bastion connection.
func ConnectFunc ¶
ConnectFunc is a convenience method for returning a function that just uses net.Dial to communicate with the remote end that is suitable for use with the SSH communicator configuration.
func PasswordKeyboardInteractive ¶
func PasswordKeyboardInteractive(password string) ssh.KeyboardInteractiveChallenge
An implementation of ssh.KeyboardInteractiveChallenge that simply sends back the password for all questions. The questions are logged.
Types ¶
type Communicator ¶
type Communicator struct {
// contains filtered or unexported fields
}
Communicator represents the SSH communicator
func New ¶
func New(v cty.Value) (*Communicator, error)
New creates a new communicator implementation over SSH.
func (*Communicator) Connect ¶
func (c *Communicator) Connect(o provisioners.UIOutput) (err error)
Connect implementation of communicator.Communicator interface
func (*Communicator) Disconnect ¶
func (c *Communicator) Disconnect() error
Disconnect implementation of communicator.Communicator interface
func (*Communicator) ScriptPath ¶
func (c *Communicator) ScriptPath() string
ScriptPath implementation of communicator.Communicator interface
func (*Communicator) Start ¶
func (c *Communicator) Start(cmd *remote.Cmd) error
Start implementation of communicator.Communicator interface
func (*Communicator) Timeout ¶
func (c *Communicator) Timeout() time.Duration
Timeout implementation of communicator.Communicator interface
func (*Communicator) Upload ¶
func (c *Communicator) Upload(path string, input io.Reader) error
Upload implementation of communicator.Communicator interface
func (*Communicator) UploadDir ¶
func (c *Communicator) UploadDir(dst string, src string) error
UploadDir implementation of communicator.Communicator interface
func (*Communicator) UploadScript ¶
func (c *Communicator) UploadScript(path string, input io.Reader) error
UploadScript implementation of communicator.Communicator interface