Documentation ¶
Overview ¶
Package remote provides the remoting facilities for agentless execution. This set of structs and methods are for running mgmt remotely over SSH. This gives us the architectural robustness of our current design, combined with the ability to run it with an "agent-less" approach for bootstrapping, and in environments with more restrictive installation requirements. In general the following sequence is run:
- connect to remote host
- make temporary directory
- copy over the mgmt binary and graph definition
- tunnel tcp connections for etcd
- run it!
- finish and quit
- close tunnels
- clean up
- disconnect
The main advantage of this agent-less approach, is while multiple of these remote mgmt transient agents are running, they can still exchange data and converge together without directly connecting, since they all tunnel through the etcd server running on the initiator.
Index ¶
- type Flags
- type Remotes
- type SSH
- func (obj *SSH) Close() error
- func (obj *SSH) Connect() error
- func (obj *SSH) Exec() error
- func (obj *SSH) ExecExit() error
- func (obj *SSH) Go() error
- func (obj *SSH) Sftp() error
- func (obj *SSH) SftpClean() error
- func (obj *SSH) SftpCopy(src, dst string) (int64, error)
- func (obj *SSH) SftpGraphCopy() (int64, error)
- func (obj *SSH) SftpHash(local, remote string) (bool, error)
- func (obj *SSH) Stop() error
- func (obj *SSH) Tunnel() error
- func (obj *SSH) TunnelClose() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Remotes ¶
type Remotes struct {
// contains filtered or unexported fields
}
The Remotes struct manages a set of SSH connections. TODO: rename this to something more logical
func NewRemotes ¶
func NewRemotes(clientURLs, remoteURLs []string, noop bool, remotes []string, fileWatch chan string, cConns uint16, interactive bool, sshPrivIDRsa string, caching bool, depth uint16, prefix string, converger cv.Converger, convergerCb func(func(map[string]bool) error) (func(), error), flags Flags) *Remotes
NewRemotes builds a Remotes struct.
func (*Remotes) Exit ¶
Exit causes as much of the Remotes struct to shutdown as quickly and as cleanly as possible. It only returns once everything is shutdown.
func (*Remotes) NewSSH ¶
NewSSH is a helper function that does the initial parsing into an SSH obj. It takes as input the path to a graph definition file.
type SSH ¶
type SSH struct {
// contains filtered or unexported fields
}
The SSH struct is the unit building block for a single remote SSH connection.
func (*SSH) ExecExit ¶
ExecExit sends a SIGINT (^C) signal to the remote process, and waits for the process to exit.
func (*SSH) Sftp ¶
Sftp is a function for the sftp protocol to create a remote dir and copy over the binary to run. On error the string represents the path to the remote dir.
func (*SSH) SftpGraphCopy ¶
SftpGraphCopy is a helper function used for re-copying the graph definition.
func (*SSH) SftpHash ¶
SftpHash hashes a local file, and compares that hash to the result of a remote hashing command run on the second file path.
func (*SSH) Tunnel ¶
Tunnel initiates the reverse SSH tunnel. You can .Wait() on the returned sync WaitGroup to know when the tunnels have closed completely.
func (*SSH) TunnelClose ¶
TunnelClose causes any currently connected Tunnel to shutdown.