Single and Multi Target Automations
You can use single target or multi target automations to execute script automations.
The parameter with the name target has special meaning to script automations as it defines the system on which the automation will run. The system can be defined by a short hostname, a FQDN, or an IP address. When executed a script automation will connect to the system identified by the target and execute the script there.
The execution result of the script will be reflected in the status of the automation. Possible automation states are executing, successful, unsuccessful, failed, and unknown. In the case of a fully automated runbook execution, this status will also be used to decide whether the runbook will be canceled or continued.
- An automation which receives prod-server1, as the content of the target variable will execute this automation on the system prod-server1. The script exited with return code of zero and the state of the automation instance is set to successful.
- An automation which receives 192.168.55.56, as the content of the target variable will execute this automation on the system with the matching IPv4 address. The script exited with a non-zero return code and the state of the automation instance is set to unsuccessful.
- An automation which ran in step 1 of a fully automated runbook failed to reach the endpoint (for example because the server was not available) and the automation could not be executed at all. The status of the automation instance is failed. This status is reflected in the status of the execution. The execution will stop after the first step and report a failure.
Multi Target Automations
The other mode of operation of an automation is the Multi Target Automation (MTA). In order to execute an automation as an MTA, specify the target string in the following format: [ $target1, $target2, …, $targetN ].
- The target string must begin with a bracket ( [ ) and must end with a bracket ( ] ).
- Between the brackets define a list of systems separated by a comma (,).
- Duplicated entries are detected and ignored. This means specifying the same target multiple times will have no effect.
- An empty list is also allowed.
- For every entry in the comma-separated list, the script will be executed on the specified target. Note: you cannot specify the same target more than once.
- All actions and information are summarized in one log. This log follows a specific format, see Output format of Multi Target Automations.
- The status of the execution will be executing as long as at least one execution is still ongoing and successful once all script processes are finished. The result will be successful even if some or even all automations reported unsuccessful, failed, or unknown.
- Specifying an empty array is allowed. This special case is called a Conditional Automation. No actual execution occurs, but an execution record is still created. The record will always report successful as its state. If the runbook is executed fully automated, the runbook instance will proceed to the next step.
- An automation receives [prod-server1] as the target. It will execute the script on the system prod-server1. The script exited with a non-zero return code. The status of the execution is successful. The output of the automation instance contains information that this script execution was unsuccesful on prod-server1.
- An automation receives [prod-server1, prod-server2, prod-server3] as the target. It will execute the script on three systems in parallel. All scripts exit with zero as the return code. The output and status of each of the three script executions is written to the output. The status of the overall execution is successful.
- An automation receives  as the target. This triggers the conditional automation workflow No execution will take place. The execution record will have an almost empty output and the status will be successful.