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 action steps. You can configure which step to run next based on conditions that are evaluated after the current action has finished running. For more information, see Conditional branching.
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 action step, except if it is the last step in the runbook, provides the option to configure conditional branching. For more information, see Conditional branching.
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
.