As part of building my autopkg-conductor solution for automating AutoPkg runs, I also wanted to automate the setup of AutoPkg and JSSImporter. My colleague Graham Pugh has written a setup script for his environment, which I was able to adapt and extend for my own needs. For more details, please see below the jump.
This script is designed to set up a Mac running macOS 10.13.x or later with the following:
- AutoPkg
- JSSImporter
- The AutoPkg recipe repos defined in the script.
The script checks to see if the following components are installed. If any are missing, they’re installed on an as-needed basis:
It also installs the following Python tools and modules on an as-needed basis:
- pip
- cryptography
- requests (if not otherwise installed by AutoPkg or JSSImporter)
The script also includes the following features:
- The ability to set JSSImporter to use a Jamf Pro cloud distribution point as the master distribution point
- The ability to install either the latest release of JSSImporter or JSSImporter 0.5.1.
The reason that JSSImporter 0.5.1 is set as a specific install option is that JSSImporter 1.0 does not currently support uploading to a Jamf Pro cloud distribution point. JSSImporter 0.5.1 does support uploading to a cloud distribution point, so while the upload issues are being worked out with JSSImporter 1.x, using the older JSSImporter 0.5.1 is the currently recommended workaround.
Once these tools and modules are installed, the script does the following:
1. Configures AutoPkg to use the recipe repos defined in the AutoPkg repos section.
2. Configures JSSImporter to connect to the desired Jamf Pro server with the correct distribution point settings.
This script should not be run with root privileges or you will receive the following warning:
Instead, the script should be run by an account with sudo privileges, so that entering the account’s password will allow sudo to run specified processes with root privileges. If you try to run this script using an account without sudo privileges, you will receive the following warning:
If the script is successfully run, the script output should look similar to what is shown below.
If a Jamf Pro cloud distribution point is set as the master distribution point:
If a Jamf Pro file share distribution point is set as the master distribution point:
The script is available below. It’s also available from GitHub using the following link: