Scripting manifest creation in Munki

If you’re new to Munki, you probably have an entire fleet of Macs you have to manage. It could be hundreds, thousands, or tens of thousands. You’re not going to enroll those all by hand, are you?

But please be intentional about how you structure things. Before you run off scripting, read Another opinionated guide to Munki manifests and the original An opinionated guide to Munki manifests.

Seriously. Read those first. Don’t start scripting the creation of Munki manifests before you get the full lowdown.

I’m waiting.

Okay. You read those, right? You aren’t just itching to download a script from GitHub?

Okay. Let’s proceed.

First off, there doesn’t need to be anything terribly complicated to the script-creation of manifests. If you get in a new batch of machines with serial numbers, you can just copy a template manifest over and over again, naming the new files after the serial numbers. You could also create a script that builds the manifest from scratch based on a number of parameters (example here).

I recently created a fork of Munki Enroll. The fork is called Munki Serial Enroll, and it works similarly to Munki Enroll, except that it doesn’t use a ClientIdentifier (just creates manifests with serial numbers and display names), has different logic for laptops/desktops, and copies from existing manifest templates instead of creating the manifest on the fly.

You should not just use Munki Enroll. You should not just use Munki Serial Enroll.

But either of those can be helpful templates, which you should modify, after you’ve given serious thought to what workflow works best for your organization’s needs.

I made Munki Serial Enroll really specific for my organization’s needs, so it is not at all meant to be used out of the box, and that’s by design. It’s meant to give you a jumping-off point and some ideas. It is not meant to be used as is.

I urge you once again before you go scripting manifest creation: read Another opinionated guide to Munki manifests and the original An opinionated guide to Munki manifests first.

Know what you want to manually do repeatedly. Then start thinking about scripting it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.