Adding actions
Actions are used to run several steps automatically. Use the Actions page to create actions.
The job of an operator can involve repetitive tasks, such as, "Logon to Db2", or running the command start server dagobert45 to start a server. Actions are scripts or Ansible templates that document these steps.
If you use actions within your runbook, then the operator does not have to manually run these steps. They can run all steps with one click.
For more information about how to create actions, see Creating an action.
The runbook editor displays any created actions in the Actions pane.
Manual steps cannot contain action elements. Automated steps must be added for actions.
It is common practice for actions to contain parameters. When adding actions to a runbook, you must decide how the values of the action parameters are filled by creating a parameter mapping. Select from the following options:
-
Use a runbook parameter: a runbook parameter, which can be filled manually by an operator running the runbook, is used to fill the specific action parameter. When adding an action to a runbook, you can select existing runbook parameters or directly create a new runbook parameter.
-
Define a fixed value: the action added to the step of a runbook will always be launched with a fixed value for the parameter. (If the same action is used in a different runbook – another fixed value might be defined there.)
-
Use the default from the action: if the action defines a default value for this parameter, it is possible to use that value.
-
Use the output of a previous action: the output of an action that was added to a previous step can be used as input for the action of the current step.
-
Use the logged in user: the parameter value is filled with the username of the user, who is logged in to Runbook action at the time when the runbook is run.
Note: If the username contains the @ symbol, for example because the username is an email address, the @ symbol and all characters that follow it are removed from the username.
Conditional branching is supported for runbooks that contain automated steps. You can configure which step to run next if running the current action ends with status successful, and another step to run next if the current action ends with another status. Depending on the remediation procedures that are available for the current step, this allows you to automatically perform error handling such as the following:
- Analysis and remediation of the error
- Cleanup of leftovers from the error
- Falling back to the previous state
- Collecting diagnostic data
If a runbook runs fully automated and has conditional branching that is enabled for some steps, the resulting runbook activity reports as successful even if one or multiple steps have failed. Only if the last step fails, or if another step fails that has no conditional branching that is configured, will the overall runbook activity also be marked as not successful. For more information about the available exit states of actions, see How is the success rate of an action calculated?.
Conditional branches are primarily intended to take effect when running the runbook in fully automated mode. When running the same runbook manually, the conditional branching is also observed. The flow of execution proceeds to the appropriate target step based on the result of the automated action. If the automated action has not been run yet, the default is to proceed with the next step.
Procedure
-
In the New (or edit) runbook editor, click Add automated step.
-
Search for the action. Click the search icon and type in the search term that describes the action that you need.
-
Choose the action that you want and then click Select this action.
-
Select the parameter-mapping type. A window opens with action details and the parameter definitions. In the Mapping column, select how action parameters are to be filled with values. You can choose from the following options:
-
New runbook parameter: add a parameter. If default values are provided, update the default values as required. Enter a new parameter name and description.
-
Fixed value: an entry field is provided to enter the parameter value.
-
(Existing) runbook parameter: select the parameter from the list of existing parameters.
-
Use default: use the default value set by the action.
-
Action output: use the action output from a previous runbook step. The output value of the action will be used as the parameter value for the current action. Note, if the action in the previous runbook step is a script action or a HTTP action then you can filter the output of that action as described in Creating SSH actions or Creating HTTP actions, respectively. This option is only available if the runbook contains a previous step with an action.
-
Use logged in user: select this option to fill the parameter value with the username of the user who is logged in to Runbook action at the time when the runbook is run.
Note: If the username contains the @ symbol, for example because the username is an email address, the @ symbol and all characters that follow it will be removed from the username.
-
-
Each automated step, except for the last step, provides the option to configure conditional branching. With conditional branching enabled, you can select which step to run as the next step depending on the result of the current action (successful or not successful), or if the runbook should stop (that is, go to the end).
Next steps
-
Edit parameter configuration: if you want to edit the parameter configuration of your action, select the action and click Change parameter mappings
. Change
your settings and click Save. -
Action with errors: if the action is decorated with an error symbol, then the parameter settings are not correct. Click Change parameter mappings
to correct
the parameter settings. -
Delete an action: if you want to remove the action, click Remove selection
.