How I Upgrade Mac OS X

How I Upgrade Mac OS X
https://flic.kr/p/dkTQ9k

Last week saw the release of El Capitan the latest version of Mac OS X. Over the weekend, I did fresh installs on both of my machines. With minimal effort, I had both workstations ready to work, configured the way I like them.

tl;dr It's nerdy and totally overkill.

chef-workstation

A few years ago, I read a blog post by Josh Timberman titled OS X Workstation Management with Chef. This was in the height of my early exploration with chef and "DevOps". I loved the idea of keeping my desktop machine configuration in sync and set out to create my own version.

The result is my chef-workstation repository used in conjunction with a hosted chef instance.

I use this daily to keep my configuration in sync, but also it means I can reliably rebuild a machine from scratch with minimal effort (and without relying on backups).

Just 5 simple steps!

For my annual upgrade, I like to start fresh. I run the installer from a USB key and re-format my hard drive. This year I tried to note the steps I took following my initial login after the clean install:

  1. Update the hostname (Sys Prefs > Sharing). (I also turn on SSH access while I'm here).
  2. Install chef-dk - this handy package includes all the chef-related tools I need.
  3. Install xcode command line tools: xcode-select --install
  4. Create my /etc/chef directory. In the past, I've removed my old node and created a new one (using my validator key, kept on a usb drive). This year, I just copied the directory from a backup.
  5. Run sudo chef-client. This takes a long time.

Almost perfect...

There are a few things left for me to do once the initial chef run is complete. I'd love to have them automated eventually:

  • There doesn't seem to be a way to install apps from the Mac App Store programatically. So things like Keynote and Tweetbot have to get installed later.
  • There's a lot of logging in required after the fresh install. I use LastPass (for passwords) and Authy (for two factor auth), which both sync all the details, but I still need to re-authenticate everywhere.
  • My ~/Projects folder contains my, well, projects. I tend to re-create this (fresh clones, etc) manually. It helps weed out the cruft, but it would be nice to somehow automate.

Feel free to check out the code and offer feedback, or fork it for your very own.

James Walker

James Walker (a.k.a. walkah) is an independent developer and hacker. He is a long time Drupal developer, but these days spends more time in Python, Ruby and Javascript.

You can follow him on twitter or github.

related posts