ssh
Run a command on a remote machine using SSH and return the result
Installation
dagger install github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051Entrypoint
Return Type
Ssh !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| destination | String ! | - | Destination to connect to (SSH destination) |
| identityFile | Secret ! | - | Private key to connect |
| cache | Boolean | false | Enable caching of commands |
Example
dagger -m github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051 call \
--destination string --identity-file env:MYSECRETfunc (m *MyModule) Example(destination string, identityFile *dagger.Secret) *dagger.Ssh {
return dag.
Ssh(destination, identityFile)
}@function
def example(destination: str, identity_file: dagger.Secret, ) -> dagger.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
dagger -m github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051 call \
--destination string --identity-file env:MYSECRET base-ctrfunc (m *MyModule) Example(destination string, identityFile *dagger.Secret) *dagger.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
dagger -m github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051 call \
--destination string --identity-file env:MYSECRET destinationfunc (m *MyModule) Example(ctx context.Context, destination string, identityFile *dagger.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
dagger -m github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051 call \
--destination string --identity-file env:MYSECRET optsfunc (m *MyModule) Example(destination string, identityFile *dagger.Secret) []*dagger.SshSshopts {
return dag.
Ssh(destination, identityFile).
Opts()
}@function
def example(destination: str, identity_file: dagger.Secret, ) -> List[dagger.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
dagger -m github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051 call \
--destination string --identity-file env:MYSECRET cachefunc (m *MyModule) Example(ctx context.Context, destination string, identityFile *dagger.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
dagger -m github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051 call \
--destination string --identity-file env:MYSECRET command --args string1 --args string2func (m *MyModule) Example(destination string, identityFile *dagger.Secret, args []string) *dagger.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
dagger -m github.com/samalba/dagger-modules/ssh@296cf44af17649e435dce578b80e2c875b560051 call \
--destination string --identity-file env:MYSECRET script --content stringfunc (m *MyModule) Example(destination string, identityFile *dagger.Secret, content string) *dagger.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 moduleFunction SshSshopts.identityFile is not accessible from the ssh moduleFunction SshSshopts.identityFile is not accessible from the ssh moduleFunction SshSshopts.identityFile is not accessible from the ssh moduleport() 🔗
Return Type
Integer ! Example
Function SshSshopts.port is not accessible from the ssh moduleFunction SshSshopts.port is not accessible from the ssh moduleFunction SshSshopts.port is not accessible from the ssh moduleFunction SshSshopts.port is not accessible from the ssh modulelogin() 🔗
Return Type
String ! Example
Function SshSshopts.login is not accessible from the ssh moduleFunction SshSshopts.login is not accessible from the ssh moduleFunction SshSshopts.login is not accessible from the ssh moduleFunction SshSshopts.login is not accessible from the ssh module