In this example, you’ll run a job that lists the installed software on your nodes (minions). In your role as an IT system administrator or DevOps team member, you sometimes need to get a snapshot of which software applications are installed on your nodes and which versions of the software they are running. For example, you might need this information in order to provide software reports to management or sometimes you need this information in order to determine whether you need to plan software upgrades. You’ll learn how to use Tanzu Salt to check for installed software packages in this kind of scenario.
To create and run a job that lists the software packages that are installed on your minions:
Create a new job.
a. In the Tanzu Salt user interface, open the Jobs workspace by clicking Config > Jobs in the side menu.
b. Click the Create Job button.
Note:
If you don’t see the Create Job button, you do not have permission to create new jobs. Contact your vRA administrator for access or to create this job on your behalf so that you can complete the tutorial.
Enter the details for the new job and save the job.
Field | Sample value |
---|---|
Name | Give this job a descriptive name such as “List installed software.” |
Description | Add a description that tells other users the purpose of this job, such as “Lists software packages installed on targeted devices.” |
Command | Select salt. The |
Targets | Do not select anything from this menu. Leaving this field blank allows you to select the target at the time you run the job. |
Function | Click this field and begin typing This field is where you select the Salt module that is applied when this job is run. |
Arguments | This module does not accept arguments, so leave it blank. |
Job Inputs | This job does not require any job inputs, so leave it empty. For more information about job inputs, see How do I create jobs. |
Now that you’ve created a job, run the job by selecting the job targets.
a. In the side menu, click Targets to open the Targets workspace and view your targets.
b. Verify that the All Minions target is selected. Inside the All Minions target, click the Run Job button.
c. In the Run Job dialog box, click the Job menu and select the Sample Disk Usage job you created in the previous steps. You can type the name of the job to filter the jobs if needed.
d. Click Run Now. If you successfully ran the job, a notification appears that explains the job was successfully started.
Check whether the job is complete or not by clicking Activity > Completed in the side menu.
If you don’t see your job in this table, it might still be in progress. You can find jobs that are currently running by clicking Activity > In Progress. Continue refreshing Activity > Completed until your job appears in the table.
When your job is complete and appears in the table, review the job results.
a. Find the row that displays your job and click its JID (job identification number).
Note:
The JID appears as a hyperlinked number with 20 digits. For example, one possible JID could be: 20210823204015061902.
b. In the job results, click the List Packages tab. This tab displays a summary of how many packages are installed on each minion that was targeted by the job, including the name of the package and the version it is running.
c. Click the double arrows next to each minion to show a detailed list of packages, including the name of the package and the version it is running.
d. Review the job’s raw data on the Raw tab to compare outputs.
As you review the job results, consider the following points: