Designing a Runbook with Visual Designer
Use the visual designer to design and create custom runbooks in Fleet Application Management. The designer provides a drag interface with an option to add code so that you can create and edit runbooks more easily. Runbook can be written in YAML or JSON. However, you can create a runbook without the need to author it in native JSON or YAML by using the visual designer.
With the visual designer, you can perform the following tasks:
- Design a runbook by using the runbook components.
- Streamline the runbook operation.
- Configure conditional statements with the condition builder.
- Configure conditional task runs based on product components, input and output variables, or both.
- Configure error handling.
- Illustrate runbooks provided by Fleet Application Management.
- Clone illustrated runbooks to help you create custom runbooks where you add your code in the source or designer mode.
As you create a runbook, the visual designer validates your work and automatically generates code. You can review the generated code or export it for local development. After you create the runbook, you can save it, publish it, and examine the results on the Console.
- The actions pane on the right side contains the Components and Properties tabs.
- The canvas in the center is a placeholder where you design the runbook. You can drag the components from the actions pane such as parallel or rolling resource groups, and drag tasks into these groups. You can change the order of the components on the canvas by placing them in the order in which you want the tasks to be run, or select actions to configure properties or handle errors.
The canvas also contains the edit icon next to each task component to view and modify the runbook task.
To view the automatically generated YAML or JSON code for the runbook as you're using the visual designer, select Code view on the canvas. When you update the YAML or JSON, the changes are automatically generated in the designer mode.
Actions Pane
From the actions pane, you can select components to drag into the work area on the canvas. The pane contains the following items:
Components Tab
To add a task, you must first add a parallel or rolling resource group. A task must be inside a group. For more information about the usage of group types, see Creating a Runbook.
- New task: Use this button to create tasks for a runbook. You can now add a task that can run a script by specifying the action type as a script.
- Parallel task group: Any tasks part of a parallel task group are run parallel on a resource (Compute and database resources) that are part of a fleet.
For example, If a fleet has two resources and two tasks (task1 and task2) that are part of the parallel task group, task1 and task2 run parallel on resource1 and resource2.
- Parallel resource group: Any tasks part of a parallel resource group are run parallel across resources (Compute and database resources) that are part of a fleet. Within a resource, the tasks that are part of a parallel resource group run sequentially.
For example, If a fleet has two resources and two tasks (task1 and task2) in the parallel resource group, task1, and task2 run one after the other on resource1 and resource2. The tasks on resource1 and resource2 run in parallel.
- Rolling resource group: Any tasks part of a rolling resource group run sequentially across resources (Compute and database resources) that are part of a fleet. Within a resource, the tasks that are part of a rolling resource group run sequentially.
For example, if a fleet has two resources and two tasks (task1 and task2) in the rolling resource group, task1 and task2 run sequentially on resource1. After the tasks on resource1 finish, task1 and task2 run sequentially on resource2.
Properties Tab
The Properties tab provides settings to control the conditional statements and configure error handling of the components you add to the canvas. After you add a component to the work area on the canvas under Tasks or Rollback tasks, configure it to meet your use case. Select the properties icon (
) of the component to configure its properties and options. You can also see the YAML or JSON code by selecting Code view. The properties are available for a runbook, groups, and tasks.
Runbook Properties
The following are the two properties for a runbook:
- On failure of tasks: The option you select for this property is the default value for all groups and tasks inside a runbook.
- Run on: The option you select describes where and how tasks are run. It can involve scheduled instances, self-hosted environments, or instances selected based on the outcomes of previous tasks. The following are the subproperties of Run on:
- Instances specified by schedule: Use this property to run a runbook on a target when the condition is true. This option is best for managing product stack workflows within a runbook.
- Self-hosted instance: This property helps you locate and select a self-hosted instance for post-provisioning tasks
- Instance specified by previous task: Use this property when a task must run only after a previous task completes.
Group Properties
The following are the five properties of a group:
- On failure: The option you select for this property decides the next set of actions if one of the tasks of a group fails. If you select Continue, the runbook continues running on the target. If you select Terminate, both the product runbook on the target and the product stack runbook for the action group stop. If you select Rollback, the runbook operation moves to the rollback step. Based on the rollback scope, the rollback action can be on the target or action group level.
- Precondition: Specifies the condition by using input variables from the current task and output variables from all previous tasks. A task runs on the target only if the condition is true.
- Run on: Specifies the condition by using the target product name (for product stack runbooks), product properties, component name, and the component properties of the target. A task runs on the target only if the condition is true.
For example, in the Oracle WebLogic Server and Java Patching product stack runbook, to run a task only on the Oracle WebLogic Server target if its java_version property value is
1.8.0_391and when the ADMIN_SERVER component is available, enter the following condition.target.product.name == "Oracle Weblogic Server" AND target.product.properties.java_home == "1.8.0_391" AND target.product.components.ADMIN_SERVER.properties.Server == "AdminServer" - Pause runbook process: This option stops the runbook operation until you intervene or the set duration ends. The pause occurs before the next task runs.
- Notification: Notifies you by using the OCI Notification service about the task status.
Task Properties
Tasks include an extra property in comparison to a group. The following is the description of the property:
Output variable mapping: For the Run a script task type, the output of the script logs are parsed to evaluate the value of the input variable with a pattern match of $$VARIABLE=VALUE$$.
- Select the output variable checkbox and add an output variable. When you run the Fleet Application Management script, it fills in the output variable.
- In the next task, select the input variable checkbox and add an input variable.
- Map the input variable name to the previous tasks output variable name using Output variable mapping.
The Fleet Application Management script now parses the output logs to identify a pattern such as $$VARIABLE=VALUE$$.
Library Tab
The Library tab of tasks provide a list of ready-to-use reusable tasks that exist in Fleet Application Management or that you created. You can use the drag handle icon (
) at the right corner of a task to drag it into the runbook's work area on the canvas. The library displays only the relevant tasks for a runbook based on the product or product stack and OS type.
Rollback Tasks
To roll back a defined task if it fails, you can add a group and then add the tasks to roll back within the Rollback tasks placeholder on the work area of the canvas. To roll back, ensure you select the On Failure task property as Rollback under Tasks for the specific task.
You can scope the rollback to a target or action group levels. This scoping means Fleet Application Management runs the rollback tasks on a specific target or all groups of targets. The rollback tasks run on the target that fails if you scope for a target, whereas the rollback tasks run on all the group of targets if you scope for an action group.
Canvas
After you determine an action to add to the visual designer, drag a component into the work area of the canvas. To change the order of the components, use the drag handle icon (
) at the right corner of a component to drag it to a different place on the runbook's work area. This new action is added to the work area and its code is automatically generated.
Keyboard Shortcuts for Navigation
| Keyboard Shortcut | Action |
|---|---|
| Tab | Navigate the focus to the next runbook element. |
| Shift+Tab | Navigate the focus to the previous runbook element. |
| Arrow keys | Move a component after that's on the canvas. For example:
|
| Spacebar or Enter/Return | Select a component from the Components or Properties tab, or a runbook element. |
| Esc | Cancel the move of a component onto the canvas, or any action before it's triggered. |
| Spacebar or Enter | Trigger an appropriate activity when the focus is on any of the components, properties, or runbook elements. For example:
|