Update: The instructions below will be obsolete once Munki 3 is released. More details on the Munki 3 implementation can be found on the Munki wiki.
Apple did some things to break that process for 10.12.4. People are in the process of finding workarounds for it.
One option is to use the built-in startosinstall tool that comes with the installer bundle.
If you import the bundle into Munki, you’ll want to have both a preinstall_script and a postinstall_script.
The preinstall_script checks to make sure there aren’t other updates pending, since startosinstall will run its own reboot independent of Munki. The pending updates should be 1 (it’s the only 1) or 0 (it was part of a set of updates that did complete and then the pending updates cleared, and you’re trying again):
# Make sure there is only one pending update (this one)
pending_count=$(defaults read /Library/Preferences/ManagedInstalls PendingUpdateCount)
# If it’s 1 or 0, we’re good to go
if [ “$pending_count” == 1 ] || [ “$pending_count” == 0 ]; then
# Otherwise, abort the installation
sudo “/Applications/Install macOS Sierra.app/Contents/Resources/startosinstall” –applicationpath “/Applications/Install macOS Sierra.app” –agreetolicense –nointeraction
P.S. There is now a recommendation on the createOSXinstallPkg README to upgrade using 10.12.3 or investigate using startosinstall.
P.P.S It’s possible, instead of my funky workaround with the preinstall_script, that you could use the –pidtosignal option instead with Munki. Here’s an example using JAMF.
P.P.P.S. Looks as if Greg Neagle has started working on integrating startosinstall into Munki “natively”—yes!