Setting up and using AutoPkg .munki recipes

Install AutoPkg

You can find and install the latest release from the AutoPkg GitHub page.

Set up AutoPkg for Munki

Once it’s installed, you can run

autopkg search munkitools

to search for any AutoPkg recipes that have munkitools in them.

Here’s an example of what the search results might look like:


Name                                   Repo                  Path                                    
----                                   ----                  ----                                    
munkitools2.santa.recipe               arubdesu-recipes      santaRecipes/munkitools2.santa.recipe   
munkitools3.munki.recipe               recipes               munkitools/munkitools3.munki.recipe     
munkitools2.munki.recipe               recipes               munkitools/munkitools2.munki.recipe     
munkitools2-autobuild.munki.recipe     recipes               munkitools/munkitools2-autobuild.munki.recipe
munkitools3-autobuild.munki.recipe     recipes               munkitools/munkitools3-autobuild.munki.recipe
AutoPkg-Release.munki.recipe           thenikola-recipes     AutoPkg-Release/AutoPkg-Release.munki.recipe

To add a new recipe repo, use 'autopkg repo-add '

You should see that munkitools3.munki.recipe is part of the recipes repo, so you should add that repo to have access to the recipes in it:

autopkg repo-add recipes

Then you can make an override for the munkitools3.munki recipe, so you can use it properly.

autopkg make-override munkitools3.munki
Override file saved to /Users/username/Library/AutoPkg/RecipeOverrides/munkitools3.munki.recipe

You’ll also want to make an override for the MakeCatalogs recipe as well:

autopkg make-override MakeCatalogs.munki
Override file saved to /Users/username/Library/AutoPkg/RecipeOverrides/MakeCatalogs.munki.recipe

The MakeCatalogs recipe will see if anything new is imported into your Munki repo, and then will run makecatalogs if necessary, so your clients can see the changes.

Make sure you fail recipes that don’t have trust info:

defaults write com.github.autopkg FAIL_RECIPES_WITHOUT_TRUST_INFO -bool YES

One final thing you want to do is tell AutoPkg where you Munki repo is:

defaults write com.github.autopkg MUNKI_REPO /Users/Shared/munki_repo

Now, you’re ready to run your first .munki AutoPkg recipe.

Using AutoPkg

Try running one .munki recipe:

autopkg run -v munkitools3.munki MakeCatalogs.munki

The -v flag just gives you some more verbose output. You can run it without -v for less verbose output, or you can run it with several (-vvv) for even more verbose output.

Make a bunch more overrides for recipes:

autopkg make-override AdobeFlashPlayer.munki
autopkg make-override GoogleChrome.munki
autopkg make-override Firefox.munki
autopkg make-override Skype.munki
autopkg make-override Spotify.munki
autopkg make-override VLC.munki

You should then be able to run a series of .munki recipes all together:

autopkg run -v AdobeFlashPlayer.munki GoogleChrome.munki Firefox.munki Skype.munki Spotify.munki VLC.munki munkitools3.munki MakeCatalogs.munki

MunkiAdmin items view

Now if you go back to MunkiAdmin and Reload your repo, you should see a bunch of new things that AutoPkg fetched.

If you’re confused a bit about overrides and trust info, you should really read AutoPkg and recipe parent trust info

I’ve also written up a script that will prompt you to approve changes in recipes that have been updated.

You may also want to check out a project called AutoPkgr, which provides a point-and-click GUI for managing AutoPkg repositories and recipes. Just keep in mind that the project is good, but it’s also hasn’t been actively developed in a while.

Leave a comment

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