Schedule a task
Schedule a task to perform single-action executions at a particular date and time or on a recurring schedule.
Install the tasks you want to use.
Make sure you have access to the nodes you want to target.
Make sure you have permissions necessary to run tasks.
If a reboot occurs or you restore a backup, scheduled Puppet jobs are rescheduled based on the last execution time. If a reboot is caused by a scheduled Puppet job running in the orchestrator, that job returns a failed status.
- In the console, in the Orchestration section, click Tasks.
- Click Run a task in the upper right corner of the Tasks page.
- In the Code environment field, select the environment where you installed the module containing the task you want to run. The default is
production
. - In the Task field, select a task to run. For example,
service
.If the tasks you expect are not available, you either have no tasks installed, or you don't have the correct permissions to run them. - Optional: In the Concurrency limit field, specify the number of nodes on which the task can be executed simultaneously.
- Optional: In the Task description field, provide a description. The text you enter here appears on the task list and task details pages.
- Optional: If you want to limit how long the task can run before being automatically cancelled, under Timeout, select Yes and specify a time interval (such as 5 minutes).
- Under Task parameters, add optional parameters and enter values for the optional and required parameters on the list.
You must click Add to task for each optional parameter-value pair you add to the task.
To view information about required and optional parameters for the task, select View task metadata below the Concurrency limit field.
Express values as strings, arrays, objects, integers, or Booleans. You must express empty strings by entering a pair of double quotation marks with no space between (
""
). Structured values, like arrays, must be valid JSON.Tasks that have default values use the default values when running unless you specify other values.
The parameters you supply the first time you run a task are used for subsequent task runs when you use Run again on the Task details page. - Click Next: Select nodes.
- Under Node selection method, from the dropdown, select a
target type.
- Node list: Add individual nodes by name.
- PQL Query: Use the Puppet query language to retrieve a list of nodes.
- Node group: Select an existing node group.
For details about the target options, refer to Run a task on one or more specific nodes, Run a task on a PQL query, and Run a task on a node group.
- When you have used one of the node selection methods to select the nodes you want to target click Next: Review and schedule.
- Under Schedule, select Later and choose a start date, time, time zone, and frequency for the job to run.
- Optional: To repeat the job on a regular schedule, change the run frequency from Once to Hourly, Daily, or Weekly.
If a recurring job's run overlaps with the next scheduled run, the job skips the overlapped time and doesn't run again until the next scheduled start time.
- Click Schedule task.
Your job appears on the Scheduled Tasks tab of the Tasks page.