Create custom profiles using JamfUploader without a template file
Introduction
JamfUploader contains AutoPkg processors for performing actions that affect a Jamf Pro server, such as uploading a package, creating a policy, updating a configuration profile, and much more. This post concerns creating custom macOS configuration profiles.
Traditionally, if you’re using the JamfUploader processor JamfComputerProfileUploader to create a custom profile, you first have to make a PLIST file, save that in your recipe repo or overrides folder, and reference that file in the recipe. An example PLIST would be something like this one for the VLC App:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SUEnableAutomaticChecks</key>
<false/>
<key>SUHasLaunchedBefore</key>
<true/>
<key>SUSendProfileInfo</key>
<false/>
</dict>
</plist>
Now you can do away with the PLIST files
I’ve created a new, simple AutoPkg processor, CreatePlist, which will take an input dictionary from the recipe itself, and create a PLIST file in the recipe’s cache directory. This can then be used in a subsequent JamfComputerProfileUploader process (or any other process that requires a PLIST file as an input). The recipe can be in PLIST or YAML format.
Here’s an example recipe:
Identifier: com.github.grahampugh.recipes.tests.CreatePlist
MinimumVersion: "2.3"
Input: {}
Process:
- Processor: com.github.grahampugh.recipes.commonprocessors/CreatePlist
Arguments:
output_file_name: VLC
plist_content:
SUEnableAutomaticChecks: False
kSUHasLaunchedBefore2: True
SUSendProfileInfo: False
- Processor: com.github.grahampugh.jamf-upload.processors/JamfComputerProfileUploader
Arguments:
identifier: org.videolan.vlc
profile_name: "%output_file_name%"
payload: "%plist_path%"
profile_category: Applications
profile_template: Profile-single-group.xml
profile_computergroup: All Managed Clients
replace_profile: "True"
Note that the plist_content value can contain strings, integers, dictionaries and arrays:
plist_content:
key1: value1
key2: True
key3: 0
key4:
dict1: "0.0"
dict2: "%substituted_value%"
key5:
- example
- example2
Incidentally, it is possible to also manufacture a .mobileconfig file using this method. However, safe to say that this method is more suited to simple custom profile, the type you might upload to the “Application & Custom Settings” section of a configuration profile in Jamf Pro.
The new processor is available in the grahampugh-recipes AutoPkg repo.
Other recent updates to JamfUploader
JamfUploader is heavily used by my current team, so I’ve been busy extending its capabilities and keeping it up to date:
-
The legacy
dbfileuploadendpoint has now been removed fromJamfPackageUploader, since we’re now 20 point releases in to its removal and the introduction of the/api/v1/packagesendpoint. The/api/v1/jcdsendpoint has also been removed from the Jamf Pro API in version 11.25, makingjcds2_modenon-functional, so I’ve removed this, too. -
I’ve updated
JamfPackageRecalculatorandJamfPackageUploaderto use the new(ish)/api/v1/cloud-distribution-point/refresh-inventoryendpoint to recalculate packages (replacing the now defunct/api/v1/jcds/refresh-inventoryendpoint). -
I’ve also made new processors for handling Static Groups using new Jamf Pro API endpoints -
JamfComputerStaticGroupUploaderandJamfMobileDeviceStaticGroupUploader. These are an alternative to using the existingJamfComputerGroupUploaderandJamfMobileDeviceGroupUploaderfor uploading a Static Group, which require an XML template. It allows you to add a description, too, which is not possible using the older Classic APIcomputergroupsandmobiledevicegroupsendpoints. These new processors require no template file. -
Smart Groups can also be uploaded using the new API, giving the ability to add a description to these, too. To do this, you use the
JamfObjectUploaderprocessor, adding the appropriateobject_typekey for computer- or mobile device smart groups; namelycomputer_groupormobile_device_group, respectively. Since the new API is JSON-based, I’ve provided a new processor to allow you to convert your old XML smart group templates to JSON -ConvertGroupXMLtoJSON.
Conclusion
As ever, if you’re using JamfUploader at all, please subscribe to the #jamf-uploader channel in the Mac Admins Slack to keep abreast of the changes, and to ask about any problems you’re encountering!