At the Lisa ’13, some folks from Google did a talk how they managing all their Desktop (and Server?) Macs at Google. Besides obvious things (like using Puppet), they mentioned another Tool, Munki, for rolling out Software and Software Updates to different Clients. Since i am using several Mac Machines (Laptop, Workstation and some VMs) that used to have a quite similar Software Stack, i decided to give Munki a try. Instead of using a dedicated Webserver, i decided to go with a Subversion Repository, for having User Authentication and Versioning at the Backend.
Munki uses some concepts for organising its stuff:
- catalogs: these are basically the Listings of Applications. Each Catalog contains some Applications to be installed.
- manifests: these are configurations for the specific client setups – e.g. Java-Dev. You can combine several Manifest Files while including one in another. You can also define mandatory and optional Packages here.
- pkgs: here are the basic DMG/PGK Packages stored. All Filenames are unique so you can have several Versions of one Program in one Repository.
- pkgsinfo: Here the Basic Application Info is stored. You can have Dependencies between Packages, as well as Requirements for installing Packages.
There is an excellent Starting Guide here and a description for a Demo-Setup, how to setup a basic Munki Installation. So i won’t repeat it here.
pkgs and pkgsinfo can be strcutured into sub-folders.
My actuals setup looks like this:
> tree -L 2 . ├── catalogs │ ├── all │ └── testing ├── manifests │ ├── developer_munki_client │ └── test_munki_client ├── pkgs │ ├── dev │ ├── media │ ├── utils │ └── work └── pkgsinfo ├── dev ├── media ├── utils └── work
So you basically configure your munki-client towards
bash-3.2$ /usr/local/munki/munkiimport --configure Path to munki repo (example: /Users/philipp/munki Repo fileshare URL (example: afp://munki.example.com/repo): https://example.com/svn/munki pkginfo extension (Example: .plist): pkginfo editor (examples: /usr/bin/vi or TextMate.app): TextMate.app Default catalog to use (example: testing): testing
After that you can use munkiimport ##path-to-dmg## for importing Applications to Munki. After you did the final Import, you can use a Tool like MunkiAdmin to configure your Client-Setup and Application Dependencies.
The next step is to commit your changes to a Repository (that is reachable under https://example.com/svn/munki). You need to update every change to the Munki Repository to keep all Clients actual. The last Step is to implement the HTTP Basic Auth Access to the Subversion Repository. There is a good Description for that as well. You need to update your /Library/Preferences/ManagedInstalls.plist Files – that should actually be moved to /private/var/root/Library/Preferences/ManagedInstalls.plist, since it now contains some User Credentials. To add this Credentials you should use this Command, where You need to have username:password as a Base64 encoded String.
defaults write /Library/Preferences/ManagedInstalls AdditionalHttpHeaders -array "Authorization: Basic V...Q="