Setting Up Munki With OS X Yosemite Server

There are many ways to set up Munki, since it’s just a webserver. The Demonstration Setup is a great way to get started, but doesn’t list the steps for setting up OS X Server. A lot of new Munki admins (or generally new Munki admins) may have an OS X Server they have access to, but not other web servers, so a guide to getting started with the latest version of OS X Server (as of writing time, that’s Server 4, on Mac OS 10.10.2 Yosemite) may be helpful.

This is all assuming you’ve got Server.app set up and running.

If the Websites service in Server.app is running, turn it off first.

The first steps are to create the Munki repo in the location that Server 4 uses to store website data:mkdir /Library/Server/Web/Data/Sites/Default/repomkdir /Library/Server/Web/Data/Sites/Default/repo/catalogsmkdir /Library/Server/Web/Data/Sites/Default/repo/pkgsmkdir /Library/Server/Web/Data/Sites/Default/repo/pkgsinfomkdir /Library/Server/Web/Data/Sites/Default/repo/manifests

In the Server.app Websites pane, edit the “Server Website” (port 80) settings:
Next to “Redirects”, click “Edit…”, and remove the only redirect (which automatically redirects port 80 to port 443 traffic). It should look like this:

If you are testing this on the OS X Server itself (i.e. you are only using one machine total), do this:sudo defaults write /Library/Preferences/ManagedInstalls SoftwareRepoURL "http://localhost/repo"sudo defaults write /Library/Preferences/ManagedInstalls ClientIdentifier "test_munki_client"

If you are testing Munki on a different client machine from the server, do this:sudo defaults write /Library/Preferences/ManagedInstalls SoftwareRepoURL "http://ip_or_domain_name_of_server/repo"sudo defaults write /Library/Preferences/ManagedInstalls ClientIdentifier "test_munki_client"

And then finally you can check to see if Munki behaves as you’d expect:sudo /usr/local/munki/managedsoftwareupdate -vv