SSH: Inputs & Outputs
Summary
Each plugin uses a set of dictionaries to store data.
These are used by plugin actions as both inputs and outputs.
This page will cover:
- The dictionaries used in this plugin
- The information each dictionary contains
Info
See SSH Client for each action's inputs & outputs.
Dictionary Types
Command
- Contains command information for the run_commands action
Example
1 2 3 4 5 |
|
Required Keys
command: The command to run
Optional Keys
success: A regular expression matching the prompt when the command succeeds (defaults to the base_prompt)
questions: A list of CommandQuestion dictionaries (defaults to null)
CommandQuestion
-
Contains prompts and responses for questions asked by a command
-
You can supply as many of these questions & answers as you need to
-
Each question prompt must be unique per-command
-
Question prompts that aren't found are ignored
Question Handling
The following process is started if question prompt is found.
- The answer to the prompted question is sent
- If the response is in
base_prompt
or success, processing is complete - Or if it's in another question prompt, go back to step 1
If a response isn't found in step 2 or 3 it will be treated as a failure.
Example
1 2 3 4 5 6 7 8 9 |
|
Required Keys
prompt: A regular expression matching the question prompt
answer: The command to run if the question is asked
SCPServer
-
Contains connection details for an SCP server
-
The example below shows the dictionary structure in YAML
Supplying Credentials
You should always use a PPA Vault integration to provide credentials to a plugin action.
Example
1 2 3 4 5 |
|
Required Keys
address: The target IP or DNS address.
port: The target SCP port.
username: Username for authentication.
password: Password for authentication.
SSHKeyAuth
-
Contains SSH connection details for key authentication
-
It is used as an input to many of the actions in this plugin
-
The example below shows the dictionary structure in YAML
Supplying Credentials
You should always use a PPA Vault integration to provide credentials to a plugin action.
Example
1 2 3 4 5 6 7 |
|
Required Keys
address: The target IP or DNS address.
port: The target SSH port.
username: Username for authentication.
private_key: RSA private key for authentication.
passphrase: The passphrase for the supplied private_key or null if not required.
base_prompt: A regular expression representing the SSH command prompt.
SSHPasswordAuth
-
Contains SSH connection details for password authentication
-
It is used as an input to many of the actions in this plugin
-
The example below shows the dictionary structure in YAML
Supplying Credentials
You should always use a PPA Vault integration to provide credentials to a plugin action.
Example
1 2 3 4 5 6 |
|
Required Keys
address: The target IP or DNS address.
port: The target SSH port.
username: Username for authentication.
password: Password for authentication.
base_prompt: A regular expression representing the SSH command prompt.