AutoPkg With Munki
So my last post was about using AutoPkg in general, but lets talk about using it with munki! It only makes sense that a tool made to automate the downloading of packages would also be able to automate adding them to your munki repo.
Once you’ve got AutoPkg set up and a few repositories added to it, you can tell it where your munki repository is located like this: defaults write com.github.autopkg MUNKI_REPO /path/to/munki_repo
- It is important to note that this writes to the autopkg plist in your user’s Library. Do not run this command with sudo, and remember you will have to do it for every user on that same machine who will be using AutoPkg with Munki.
Now, All you do is run autopkg run <recipe>.munki
and it will do the rest!
You will get some output like this:
The following new items were downloaded:
/Users/tprice/Library/AutoPkg/Cache/com.github.autopkg.munki.google-chrome/downloads/GoogleChrome.dmg
The following new items were imported:
Name Version Catalogs Pkginfo Path
---- ------- -------- ------------
GoogleChrome 29.0.1547.57 production apps/GoogleChrome-29.0.1547.57.plist
And that’s it! At this point you will have to move the files into whatever organized file structure you want and edit the pkginfo to match the catalogs you want things to be in, but that will change when we talk about overrides!