ssh
Run a command on a remote machine using SSH and return the result
Installation
dagger install github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051
Entrypoint
Return Type
Ssh !
Arguments
Name | Type | Description |
---|---|---|
destination | String ! | Destination to connect to (SSH destination) |
identityFile | Secret ! | Private key to connect |
cache | Boolean | Enable caching of commands |
Example
func (m *myModule) example(destination string, identityFile *Secret) *Ssh {
return dag.
Ssh(destination, identityFile)
}
@function
def example(destination: str, identity_file: dagger.Secret, ) -> dag.Ssh:
return (
dag.ssh(destination, identity_file)
)
@func()
example(destination: string, identityFile: Secret, ): Ssh {
return dag
.ssh(destination, identityFile)
}
Types
Ssh 🔗
baseCtr() 🔗
Return Type
Container !
Example
func (m *myModule) example(destination string, identityFile *Secret) *Container {
return dag.
Ssh(destination, identityFile).
BaseCtr()
}
@function
def example(destination: str, identity_file: dagger.Secret, ) -> dagger.Container:
return (
dag.ssh(destination, identity_file)
.base_ctr()
)
@func()
example(destination: string, identityFile: Secret, ): Container {
return dag
.ssh(destination, identityFile)
.baseCtr()
}
destination() 🔗
Return Type
String !
Example
func (m *myModule) example(ctx context.Context, destination string, identityFile *Secret) string {
return dag.
Ssh(destination, identityFile).
Destination(ctx)
}
@function
async def example(destination: str, identity_file: dagger.Secret, ) -> str:
return await (
dag.ssh(destination, identity_file)
.destination()
)
@func()
async example(destination: string, identityFile: Secret, ): Promise<string> {
return dag
.ssh(destination, identityFile)
.destination()
}
opts() 🔗
Return Type
[Sshopts ! ] !
Example
func (m *myModule) example(destination string, identityFile *Secret) []*SshSshopts {
return dag.
Ssh(destination, identityFile).
Opts()
}
@function
def example(destination: str, identity_file: dagger.Secret, ) -> List[dag.SshSshopts]:
return (
dag.ssh(destination, identity_file)
.opts()
)
@func()
example(destination: string, identityFile: Secret, ): SshSshopts[] {
return dag
.ssh(destination, identityFile)
.opts()
}
cache() 🔗
Return Type
Boolean !
Example
func (m *myModule) example(ctx context.Context, destination string, identityFile *Secret) bool {
return dag.
Ssh(destination, identityFile).
Cache(ctx)
}
@function
async def example(destination: str, identity_file: dagger.Secret, ) -> bool:
return await (
dag.ssh(destination, identity_file)
.cache()
)
@func()
async example(destination: string, identityFile: Secret, ): Promise<boolean> {
return dag
.ssh(destination, identityFile)
.cache()
}
command() 🔗
example usage: “dagger call –destination USER@HOST –identity-file file:${HOME}/.ssh/id_ed25519 command –args whoami stdout”
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] ! | - | No description provided |
Example
func (m *myModule) example(destination string, identityFile *Secret, args []string) *Container {
return dag.
Ssh(destination, identityFile).
Command(args)
}
@function
def example(destination: str, identity_file: dagger.Secret, args: List[str]) -> dagger.Container:
return (
dag.ssh(destination, identity_file)
.command(args)
)
@func()
example(destination: string, identityFile: Secret, args: string[]): Container {
return dag
.ssh(destination, identityFile)
.command(args)
}
script() 🔗
execute a remote script. similar to `command’, but the script is piped to ssh (shell escaping safe)
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
content | String ! | - | No description provided |
Example
func (m *myModule) example(destination string, identityFile *Secret, content string) *Container {
return dag.
Ssh(destination, identityFile).
Script(content)
}
@function
def example(destination: str, identity_file: dagger.Secret, content: str) -> dagger.Container:
return (
dag.ssh(destination, identity_file)
.script(content)
)
@func()
example(destination: string, identityFile: Secret, content: string): Container {
return dag
.ssh(destination, identityFile)
.script(content)
}
Sshopts 🔗
identityFile() 🔗
Return Type
Secret !
Example
Function SshSshopts.identityFile is not accessible from the ssh module
Function SshSshopts.identityFile is not accessible from the ssh module
Function SshSshopts.identityFile is not accessible from the ssh module
port() 🔗
Return Type
Integer !
Example
Function SshSshopts.port is not accessible from the ssh module
Function SshSshopts.port is not accessible from the ssh module
Function SshSshopts.port is not accessible from the ssh module
login() 🔗
Return Type
String !
Example
Function SshSshopts.login is not accessible from the ssh module
Function SshSshopts.login is not accessible from the ssh module
Function SshSshopts.login is not accessible from the ssh module