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.
The tasks that you create using this process are shared tasks and can be used by any runbook.
- Open the navigation menu and click Observability & Management. Under Fleet Application Management, click Actions and Controls.
- On the Runbooks page, click the Tasks tab.
- Click Create task.
- In the Create task panel, enter a unique name and description for the task. Avoid entering confidential information.
- 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.
- (Optional) Select a product or product stack to which the task belongs and the type of OS on which the task runs.
-
If the task is meant for discovering targets:
- 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.
-
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.
- If the task is meant for applying patches, switch on the This task needs patches to execute toggle.
- To add your script for task execution, click Browse next to Select scripts.
-
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.
-
If you selected Select from an Object Storage bucket:
- Select the compartment that contains the Object Storage bucket with the script, and then select the bucket.
- Select the checkbox next to the script files and then click Select. Skip to step 13.
-
If you selected Upload a file:
- Drag a file from the file system to the Drop a file box, or browse for the file.
- Select the compartment that contains the Object Storage bucket that you want to upload the file to, and then select the bucket.
- Select the checkbox next to the script files and then click Select. Skip to step 13.
- (Optional) For Object name prefix, specify a prefix for the file that you upload to easily identify it when selecting from Object Storage.
- Click Upload and select to store the script in the bucket and select the script for the task.
-
On the Create task panel, if the task requires input variables, switch on the Add input variables toggle and then enter the following details:
- Enter a unique name and description for the variable. Avoid entering confidential information.
- 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. - 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.
- (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
- For static arguments, provide them directly as arguments (for example, if the task script expects a timeout value), the argument can be as follows:
- Enter the
- (Optional) Select credential names that you created in Vault if not defined for the product or product stack.
-
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.
- 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.