After creating jobs and defining your targets in Tanzu Salt, you can then run the jobs against the desired targets. You can run a job or one-off command on an as-needed basis (ad-hoc) or you can schedule a job to run at a future date and time. You can also set jobs to run on a repeating schedule.
Before you can run jobs, you or your system administrator must first define the targets for your jobs, which determines which node(s) the job will run on. Then, you must create the actual job. For more information, see:
To run a job immediately from the Jobs workspace:
Search for the job you want to run.
Note:
Filters, column sorting, and column visibility settings are persistent for a given user, regardless of the device used to log in. This means that when a particular user logs in, that user sees the same filtering, sorting, and visibility settings after logging in until the filters are cleared or the sorting and visibility settings are changed.
Click the menu next to the job you want to run.
In the dialog box, select a target to run the job on.
Note:
If the job has been set to run on a specific target or Salt master, the dialog box displays the target for confirmation.
Select additional options as required, such as setting notification preferences, adding job inputs, or running the job as a test run.
You can run an ad-hoc job from the Targets workspace. You can run a job on:
To run an ad-hoc job from the Targets workspace:
Select the minion, target, or list of minions you want to run the job against.
To select a target group, click the Menu next to the target you want to run the job against and click Run job.
To select a single minion or list of minions, click the name of the target group and then select the minions you want to run the job against. Then click Run job.
In the confirmation dialog, select the job you want to run and confirm the correct target or minions are selected.
Tanzu Salt includes a Run Command control that allows you to run a single command (a Salt execution module) without defining a reusable job. You can use this feature to execute commands quickly or to run one-off commands that are not part of your everyday workflow. For example, you could run a command when troubleshooting or during to test initial configurations.
You can run an ad-hoc job or command on:
To run a command:
In the Run Command dialog, confirm the correct command and target are selected, then select a function. A function is the Salt module you want to execute on the target. Click this field and begin typing the name of the Salt module you want to select or select it from the menu.
See the Salt module index for a complete list of Salt modules. Also see Examples of common jobs for a table describing some of the most commonly used modules.
Optional: If the Salt module you are using needs certain arguments, add them in the Arguments field. Ensure you have read that Salt module’s documentation so that you know what arguments are required and in which order the arguments need to be passed.
You can use the Schedules workspace in Tanzu Salt to set a single, one-off job to run at a future date and time. You can also create repeating schedules to run jobs on a recurring basis.
To create a new schedule for a job:
Click Create Schedule.
Enter the details for the new schedule.
Field | Value |
---|---|
Name | Give the schedule a descriptive name that briefly indicates which job it runs and how frequently it runs. For example, “Daily disk capacity check.” |
Job | Select the name of the job that will run from the menu. If you don’t see your intended job, check that you have appropriate permissions with your Tanzu Salt administrator. |
Targets | Select the targets (minions) that this job should run on. See How do I create targets? for more information. |
Timezone | Jobs included in the schedule run based on the timezone indicated in this field. Jobs are saved as UTC, which means jobs will run at the specified UTC time no matter which timezone the RaaS server may be in. The timezone is saved for translation to or from UTC to your local time. Tanzu Salt automatically detects your local timezone from your web browser and uses this timezone as your default. You cannot change your local timezone. |
Type | Choose the schedule frequency from the available options. Depending on your selection and the type of job you are running, other settings become available.
|
Click Save and confirm the schedule now appears in the table of upcoming scheduled jobs.
After scheduling your job, you can use the Schedules table to run the job immediately (run now), edit the job, enable or disable the job or check its status.
After scheduling your job, you can review job status and job returns in the Activity workspace. See How do I review job status and job returns? for more information.