I wanted to create a workflow that involved pretty much just imaging a new machine with a thin image and then having the image itself pull updates. Sounds simple, but I had to do quite a bit of experimenting to figure out the exact flow.
What to include with AutoDMGInclude in the AutoDMG-created image only CreateUserPkg (for one default user), Outset (for boot and login scripts), the latest Munki tools, and a special ".pkg" that puts some scripts in place to run at boot.
The special .pkg
In addition to distributing various payloads, it's key that the special .pkg have a postinstall script that runs
One of the payloads should be a script that goes into the /usr/local/outset/boot-every directory, because Outset won't run boot-once scripts unless there's a network connection by default—you can change the preferences .plist and deploy it, but I find it easier to just use a boot-every script. This script will do several things:
- Check for a Munki preferences file. If the file exists, self-delete (otherwise the script will run at every boot).
- Create Munki preferences.
- Create the Munki bootstrap file.
- Connect to a wireless network to pull in updates.
- Reboot after waiting a minute (just to give a little time for the wireless connection to finish).***
After that, the Munki bootstrap file should take care of any subsequent reboots and updates until the machine is fully updated.