ssh
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/riftonix/daggerverse/modules/ssh@875bc512cdced2a013cfbbe891ea858f710129caEntrypoint
Return Type
Ssh !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| imageRegistry | String | "docker.io" | Helm image registry |
| imageRepository | String | "kroniak/ssh-client" | Helm image repositroy |
| imageTag | String | "3.21" | Helm image tag |
| userId | String | "65532" | Helm image user |
Example
dagger -m github.com/riftonix/daggerverse/modules/ssh@875bc512cdced2a013cfbbe891ea858f710129ca call \
func (m *MyModule) Example() *dagger.Ssh {
return dag.
Ssh()
}@function
def example() -> dagger.Ssh:
return (
dag.ssh()
)@func()
example(): Ssh {
return dag
.ssh()
}Types
Ssh 🔗
SSH dagger module
container() 🔗
Get the base container for the SSH module.
Return Type
Container ! Example
dagger -m github.com/riftonix/daggerverse/modules/ssh@875bc512cdced2a013cfbbe891ea858f710129ca call \
containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
Ssh().
Container()
}@function
def example() -> dagger.Container:
return (
dag.ssh()
.container()
)@func()
example(): Container {
return dag
.ssh()
.container()
}exec() 🔗
Functions for helm chart linting
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| destination | String ! | - | Address to connect for ssh client |
| sshPort | Integer ! | 22 | Destination port |
| sshUser | String ! | "root" | Ssh user |
| insecureSshPassword | String ! | "" | Ssh password, that can be visible in the logs |
| sshCmd | String ! | "uname -a" | Command for remote exec |
Example
dagger -m github.com/riftonix/daggerverse/modules/ssh@875bc512cdced2a013cfbbe891ea858f710129ca call \
exec --destination string --ssh-port integer --ssh-user string --insecure-ssh-password string --ssh-cmd stringfunc (m *MyModule) Example(ctx context.Context, destination string, sshPort int, sshUser string, insecureSshPassword string, sshCmd string) string {
return dag.
Ssh().
Exec(ctx, destination, sshPort, sshUser, insecureSshPassword, sshCmd)
}@function
async def example(destination: str, ssh_port: int, ssh_user: str, insecure_ssh_password: str, ssh_cmd: str) -> str:
return await (
dag.ssh()
.exec(destination, ssh_port, ssh_user, insecure_ssh_password, ssh_cmd)
)@func()
async example(destination: string, sshPort: number, sshUser: string, insecureSshPassword: string, sshCmd: string): Promise<string> {
return dag
.ssh()
.exec(destination, sshPort, sshUser, insecureSshPassword, sshCmd)
}withPrivateKey() 🔗
Add private key to container
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | File ! | - | Private key file |
Example
dagger -m github.com/riftonix/daggerverse/modules/ssh@875bc512cdced2a013cfbbe891ea858f710129ca call \
with-private-key --source file:pathfunc (m *MyModule) Example(ctx context.Context, source *dagger.File) string {
return dag.
Ssh().
WithPrivateKey(ctx, source)
}@function
async def example(source: dagger.File) -> str:
return await (
dag.ssh()
.with_private_key(source)
)@func()
async example(source: File): Promise<string> {
return dag
.ssh()
.withPrivateKey(source)
}