Skip to content

SSH exec task

A command can be executed via the Site Controller via the SSH protocol. This is done via the ExtensionTaskSsh task type.

{
"label": "show-running-config",
"taskType": "ExtensionTaskSsh",
"options": {
"host": "192.168.100.100",
"port": 22,
"timeout": 1800,
"commandTemplate": "show running config"
}
}
  • host - The host to connect to (≤255 chars).
  • port - The port to connect to (1–65535). Defaults to 22.
  • username - (optional) Username for the SSH connection.
  • password - (optional) Password for the SSH connection.
  • timeout - The timeout for executing the command, in seconds (1–30000). Defaults to 60.
  • commandTemplate - Required. The command to execute. It can be a Nunjucks (a subset of Jinja2) template referencing the stage payload objects.

The objects available to the commandTemplate depend on the stage the task is attached to — for example the server object for serverRegistered, or the switchDNSRecordSet object for switchCreateDNS. See Stage payloads for the full payload of every stage.