Skip to main content

Added v0.5

Execute commands via SSH - such as to trigger an action before or after a recipe is run.

Tabset

Run​

Recipe​

run:
on_success:
- ssh:
host: host
user: user
password: password
command: apt update

Function​

from wrangles.connectors import ssh
ssh.run(
host = 'host',
user = 'user',
password = 'password',
command = 'apt update'
)

Parameters​

ParameterRequiredData TypeNotes
host✓strHostname or IP address of the server.
user✓strThe user to connect as.
command✓str / listCommand or list of commands to execute. When providing a list, note that all commands are executed in isolation, i.e. cd /dir in a prior command will not affect the directory for later commands.
passwordstrPassword for the specified user.
key_filenamestrPath to a file that contains the private key. Either this or password must be provided.
ifstrA condition that will determine whether the action runs or not as a whole.