As part of a project, I needed to build an automated setup process for a Jamf Infrastructure Manager (JIM). Thanks to the help of some folks at Jamf, I have a process which runs non-interactively and which does the following on Red Hat Enterprise Linux 7.x:
- Installs the JIM software
- Enrolls the JIM with a Jamf Pro server
For more details, please see below the jump.
The key information I needed from Jamf was how to run an non-interactive enrollment of the JIM with a Jamf Pro server. This can be done with the following command:
/path/to/jamf-im enroll --hostname jim_hostname_goes_here --jss-url https://jamf.pro.server.here --password jamf_pro_account_password_goes_here --username jamf_pro_account_username_goes_here
This does require placing a password in the clear, so I recommend setting up an account on your Jamf Pro server which only has the required rights to enroll a JIM.
Once you’ve enrolled, you should be able to check /var/log/jamf-im.log and verify that enrollment has been successful. If it was successful, you should see log entries similar to what’s shown below:
You should also see the new JIM appear listed in your Jamf Pro server. To check this, use the following process:
1. Log into the Jamf Pro server using an admin account.
2. Go to Management: Server Infrastructure and select Infrastructure Managers.
3. You should see the new JIM listed there.
To help automate the process, I’ve written a script for CentOS 7.x / RedHat Enterprise Linux 7.x which does the following:
- Checks to see if Java is installed and installs OpenJDK 8.x if it isn’t.
- Checks for the JIM installer at a defined location
- If the JIM installer is available, installs the JIM software.
- Verifies that the JIM software has been installed.
- Enrolls the JIM with a specified Jamf Pro server, using credentials provided in the script.
Pre-requisites
- A JIM installer .rpm file for CentOS / RedHat Enterprise Linux stored in the location defined in the script.
- Credentials for the specified Jamf Pro server
When successfully run, the output of the script should appear similar to that shown below:
The script is available below, and also available on GitHub at the following address: