Creating a Runbook

Create a custom runbook in Fleet Application Management by using the visual designer.

Fleet Application Management provides several runbooks with predefined steps that you can use to perform common lifecycle management tasks such as pre-execution health checks, Oracle HTTP server discovery. These runbooks are available in the runbooks library. You can also create your runbooks and publish them for all users.
    1. Open the navigation menu and click Observability & Management. Under Fleet Application Management, click Actions and Controls.
    2. On the Runbooks tab, click Create runbook.
    3. On the Basic information page, enter a unique name and description for the runbook. Avoid entering confidential information.
    4. For Lifecycle operation, select a lifecycle operation for a fleet—for example, patch or discovery.
    5. For Runbook type, select whether the runbook is for a specific product or a product stack. Then, select the product stack or product.
    6. Select the type of OS on which the runbook runs and enter the estimated time in hours to complete the runbook execution.
    7. 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.
    8. Click Next.
    9. 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.
    10. 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.
      1. 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 (drag-handle) 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.
      2. 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 ( 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.
      3. 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.
      4. After adding the required components, select a component that you want to configure, and then click the settings icon (settings-icon) to configure it by using the Properties tab.
      5. Enter a unique step name preferably based on its purpose. Avoid entering confidential information.
      6. 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.

      7. To build conditional statements for each runbook component by using the Condition option, see Configuring Conditional Statements using the Console.
      8. 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.
      9. 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.
      10. 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.
      11. 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.
    11. 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.
    12. Click Next.
    13. On the Review page, verify the runbook information that you provided.
    14. 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.
    15. 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.