OS X Server Production Line

Something I’ve been working on for a while was to fully automate the builds for OS X Server machines. I “mostly” succeeded but had issues, the biggest being that OS X Server.app needs licence terms agreed to before it can be used.

Now in the past I found that an insurmountable obstacle when dealing with Server 4.x as there was no way to automatically accept the terms, and in the background it was doing all sorts of nasty things. I found evidence it was hooking into the mach kernel messaging system! Ow, not touching that with a 20ft pole.

Until now.

Rich Trouton has just today posted this: Automating the setup of OS X Server where he and Charles Edge have … well, it’s best if you read it. It’s the perfect example of how having talked to the right people within Apple’s engineering team can pay dividends.

Now their solution helps me with my own project a lot. I present it here:

MacMini Server AutoBuild

This is a pretty big bash script to automatically configure an OS X computer with Server.app installed to be a fully working server by the time it finishes. It’s not perfect, there’s still a couple minor bugs but they appear to be mostly serveradmin command line tool related.

Thanks guys! (Although I now have to change my presentation for MacAd UK to reflect all this now!)

If you want to use it, the basic form is that my script is meant for JAMF’s Casper Suite to be run after imaging. It should set up AFP, HTTP, Netboot and SNMP services, plus hostname and background sync services. Obviously it’ll need tailoring to your own needs. There’s a lot of other stuff in there including replication of distribution point data so you’re not working with a blank server, security for root user since we need that for rsync and a lot of other things.

The secret sauce to it all is the serveradmin command line utility. It’s possible to configure a server then get that command to output a textual set of all the settings. This can then be fed back into that command later to fully replicate a server. Hence the production line metaphor.

Anyway examine the code and hopefully it’ll be of some use to you all.

MacMini Server AutoBuild