Creating a Task

Create a runbook task for patch management in Fleet Application Management.

Note

The tasks that you create using this process are shared tasks and can be used by any runbook.
    1. Open the navigation menu and click Observability & Management. Under Fleet Application Management, click Actions and Controls.
    2. On the Runbooks page, click the Tasks tab.
    3. Click Create task.
    4. In the Create task panel, enter a unique name and description for the task. Avoid entering confidential information.
    5. For Action type, select Run a script to attach a script from Object Storage, or you can add your script inline under Command. See step 15.
    6. (Optional) Select a product or product stack to which the task belongs and the type of OS on which the task runs.
    7. If the task is meant for discovering targets:
      1. Switch on the Mark this as discovery output task toggle. This action allows Fleet Application Management to collect software inventory information from the task after it's done.
      2. Click Download discovery output template to ensure that the task output matches the discovery template format.
        Use the downloaded discovery template as a guide for coding the discovery script.
    8. If the task is meant for applying patches, switch on the This task needs patches to execute toggle.
    9. To add your script for task execution, click Browse next to Select scripts.
    10. In the Select file panel, select one of the following options:
      • Select from an Object Storage bucket: Select a script from Object Storage, if it's already been uploaded, and skip to step 11.
      • Upload a file: Select a script by uploading it to Object Storage, and skip to step 12.
    11. If you selected Select from an Object Storage bucket:
      1. Select the compartment  that contains the Object Storage bucket with the script, and then select the bucket.
      2. Select the checkbox next to the script files and then click Select. Skip to step 13.
    12. If you selected Upload a file:
      1. Drag a file from the file system to the Drop a file box, or browse for the file.
      2. Select the compartment  that contains the Object Storage bucket that you want to upload the file to, and then select the bucket.
      3. Select the checkbox next to the script files and then click Select. Skip to step 13.
      4. (Optional) For Object name prefix, specify a prefix for the file that you upload to easily identify it when selecting from Object Storage.
      5. Click Upload and select to store the script in the bucket and select the script for the task.
    13. On the Create task panel, if the task requires input variables, switch on the Add input variables toggle and then enter the following details:
      1. Enter a unique name and description for the variable. Avoid entering confidential information.
      2. For Type, select string or output variable. For example, select the type as output variable if you want the variable value to be used as an input variable for another task.
      Add more input variables as needed.
    14. If the task requires output variables, switch on the Add output variables toggle and then enter a unique name for the variable. Add more output variables as needed.
    15. (Optional) If task execution is based on several files, in the Command box, provide the command to start the execution. For example:
      • Enter the unzip zippedfile.zip command to unzip the file that contains all files, and then enter the ./main.sh command to begin the execution.
      • To pass variables to the command, provide them as command line arguments. See the following types of command line arguments:
        • For static arguments, provide them directly as arguments (for example, if the task script expects a timeout value), the argument can be as follows: ./main.sh 10s
        • For dynamic arguments based on the ones configured in the task (for example, if it expects timeout and backuptype), the argument can be as follows: ./main.sh $timeout $backuptype
        • For a combination of static and dynamic arguments, the argument can be as follows: ./main.sh 10s $backuptype
    16. (Optional) Select credential names that you created in Vault if not defined for the product or product stack.
    17. Under Task properties, enter the following details:
      • Max retries on failure: Specify a value for the number of times a task should retry when it fails.
      • Timeout: Specify a timeout value for a task in seconds when it fails.
    18. Click Create.
  • Use the oci fleet-apps-management fleet-apps-management-runbooks task-record create command and required parameters to create a runbook task:

    oci fleet-apps-management fleet-apps-management-runbooks task-record 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 CreateTaskRecord operation to create a runbook task.