The OOTB SSH command execution custom task have some limitations that made the real usage almost impossible. To avoid this limitations the following Custom SSH task has been created.
1.2 OOTB SSH Limitations
1.2.1 IP Address and Hostname
An IP address is mandatory due Input type. Most of the time the customer are askin to use an IP or a Hostname. The custom task allows that.
The username and password has to be entered on the SSH, with the Custom SSH it takes the credentials from the Credentials Policy, this make easier the maintenance and usage of the flows, because most of the time the Customer changes the admin credentials for security reasons. This Custom SSH uses the credentials from the policy, if the credentials are changed there is no need to change the credentials on the workflows.
1.2.3 Finish execution of each command
The OOTB SSH does not wait for each command to be finished, it launch the command and finish without result waiting. This Custom SSH will wait for the finish of each command.
1.2.4 STDOUT and STDERR
The custom SSH will get all the STDOUT and STDERR from all the commands executed on the SSH.
1.2.5 Highest Return Code
The custom SSH will return the highest return code of all commands, so you will be able to check if the execution was successful or not.
The custom SSH includes an option for the rollback, using the same features explained above.
1.3.1 Import the custom task using the portal
First import the custom tasks from the portal using the standard procedure:
Extract the file on the Appendix A to your local computer
Log in into the UCSD portal
Go to Policies-->Orchestration
Select the file extracted from the document and click Upload
Check that the custom task is selected
After finishing the import go to Custom Workflows Tasks tab
Check the existence of the Custom SSH Task.
1.3.2 Using Custom Task
To be able to execute the task the following inputs has to be filled.
The Undo Commands are optional, so if you don’t enter undo commands then the task will not generate any rollback task.
Mappable To Type
Commands to execute
The Account Name Input has to match the Credential Name for the credential Policy.
To create a credential policy:
Go to Policies > Physical Infrastructure Policies > Credential Policies
Click on Add
Enter the information for the Credentials
The Policy Name should match the Account Name on the task Input.
The Custom Task Flow will use the Username, Password and Port for the connection.
Just tested and created new workflow on UCSD 126.96.36.199: