Creating a Runbook
Create a custom runbook in Fleet Application Management by using the visual designer.
- Open the navigation menu and click Observability & Management. Under Fleet Application Management, click Actions and Controls.
- On the Runbooks tab, click Create runbook.
- On the Basic information page, enter a unique name and description for the runbook. Avoid entering confidential information.
- For Lifecycle operation, select a lifecycle operation for a fleet—for example, patch or discovery.
- For Runbook type, select whether the runbook is for a specific product or a product stack. Then, select the product stack or product.
- Select the type of OS on which the runbook runs and enter the estimated time in hours to complete the runbook execution.
-
To let Fleet Application Management use this runbook as the default runbook for performing lifecycle operations, select Set as default runbook.
Note
You can set only one runbook for a particular lifecycle operation and product or product stack combination as the default runbook. Fleet Application Management uses the default discovery runbook of a product or product stack to discover the software inventory of the product and the default patching runbook to automatically select a runbook during the schedule creation and compliance fix tasks. - Click Next.
-
On the Streamline (Design runbook) page, select one of the following options:
- Design: Use the visual designer by dragging the components and configuring them. Skip to step 10.
- Source: Upload the runbook code in a YAML or JSON file. Skip to step 11.
-
If you selected Design for runbook creation, perform the following steps:
Important
To add a task, you must first add a parallel or rolling resource group. A task must be inside a group. To learn about using the visual designer, see Designing a Runbook with Visual Designer.-
From the Components tab of the actions pane, select a parallel resource group or a rolling resource group and drag it on the canvas. Add as many groups as you need.
- For parallel execution of runbook tasks across resources, select a parallel group. A parallel resource group is a placeholder for one or more tasks within it, or another parallel task group that runs several tasks on a target resource in parallel. For each task that's added to a parallel resource group, the list of tasks is run one after another on a specific resource but simultaneously across a list of resources.
- For sequential execution of runbook tasks, select a rolling resource group. A rolling resource group is a placeholder for one or more tasks where the list of tasks is run one after another on a specific resource. After the tasks are run successfully in the resource, the next task is run on another resource.
Tip
You can reorder components by using the drag handle icon () at the left corner of a component and dragging it to a different location on the runbook's work area. After you place a component onto the canvas, its code is automatically generated and added to the runbook's source. -
Select a new task and drag it to a resource group that you added. Enter details in the Create task panel. For instructions, see steps 4 to 17 in Creating a task using the Console. You can also add a predefined task by dragging it to a resource group.
- The tasks you create within the runbook are local to the runbook and can't be reused by other runbooks.
- The tasks library provides a list of reusable tasks that exist, or that you created. You can use the drag handle icon ( ) at the left corner of a task to drag it into the resource group. Tip
You can first create runbook tasks as needed and then add them to one or more runbooks later. - To create a copy of the task in the task library, select Make a copy of this task in library. This task is then a part of the runbook and the task library. However, you can reuse and update the library task independent of the runbook task.
- To update the properties of a task, click the edit icon next to the task and then update the field values in the Edit task panel.
- After adding the required components, select a component that you want to configure, and then click the settings icon () to configure it by using the Properties tab.
- Enter a unique step name preferably based on its purpose. Avoid entering confidential information.
-
Select one of the following actions from the On failure list to configure how automation can handle errors in the runbook's workflow:
Note
By default, when a runbook component reports an error, the Fleet Application Management automation stops the runbook's workflow entirely. This is because the default value for the On Failure property for all components is Abort.
- Abort: Stop the runbook's workflow entirely when the component execution fails. This action is set by default.
- Continue: Continue to the next step in the runbook workflow when the component execution fails.
- Rollback: Undo the change and return to the level at which the runbook component was initially.
To roll back, ensure you select the On Failure property as Rollback. You can specify the rollback function at the target or group levels (action group.) To roll back at the target level, select On failure of tasks or select On failure of rollback tasks to roll back at the group level.
- To build conditional statements for each runbook component by using the Condition option, see Configuring Conditional Statements using the Console.
- Configure Run on to allow a task to run conditionally only on certain components applicable to the product (as defined in the product metadata) on the resource. For instructions on how to add conditions, see Configuring Conditional Statements using the Console.
- Switch on the Pause execution toggle to halt or delay the running of tasks for a specific time until certain conditions are met. For example, you can choose to pause the running of a task for 60 minutes, indefinitely, or until you resume the task.
- To get notified when the task status changes, switch on the Notification toggle, and then select the activity of the task for which you want to be notified—for example, on pause, on task failure, or when the task succeeds.
- Configure the properties of the tasks that you add. For field description of task properties, see steps 4 to 17 in Creating a Task using the Console.
-
From the Components tab of the actions pane, select a parallel resource group or a rolling resource group and drag it on the canvas. Add as many groups as you need.
- If you selected Source for runbook creation in step 9, select whether you're using JSON or YAML and then click Upload runbook code to add the appropriate file.
- Click Next.
- On the Review page, verify the runbook information that you provided.
-
To save the runbook initially until you're sure of all the components, click Save as draft.
This draft version of the runbook isn't active, can't be used, and is marked as a draft.
-
To make the runbook usable after you're sure about all its tasks and streamline (sequence of execution), click Publish.
The published runbook can be used for discovery, application of patches, or rollback, and it has an active status.
Use the oci fleet-apps-management fleet-apps-management-runbooks runbook create command and required parameters to create a custom runbook:
oci fleet-apps-management fleet-apps-management-runbooks runbook create [OPTIONS]
For a complete list of flags and variable options for Fleet Application Management CLI commands, see the CLI for Fleet Application Management.
Run the CreateRunbook operation to create a custom runbook.