beckmanshire-chef is a complete Chef repository containing the cookbook and configuration files necessary for bootstrapping a macOS development machine. This repository is completely self-contained -- the cook is required to download the various cookbook dependencies via Berkshelf and rsync the repo to the target machine (see "Bootstrap Instructions" section below).
The following sections describe the necessary prerequisites that should be installed/configured on the target machine
before running the chef-client
to bootstrap.
- Install VMWare Tools.
- NOTE: You may have to completely shutdown (rather than reboot) the VMWare VM after installing VMWare Tools for the screen resolution to adjust out of 1024x768.
- Disable Messages and FaceTime.
- Copy SSH public key from controller / host to the target machine.
- NOTE: It may be preferable to use an SSH key without a passphrase specifically for this purpose.
ssh-copy-id -i ~/.ssh/keys/vm-macos-ssh username@vm-hostname
- Configure
System Preferences / Sharing
- Enable
Remote Login
for SSH access. - Change
Computer Name
andLocal Hostname
.
- Enable
- Edit
/etc/sudoers
to add the following to enable passwordless SSH access.
%admin ALL = (ALL) NOPASSWD:ALL
- Install XCode from the AppStore and accept the license agreement.
sudo xcodebuild -license accept
- Install the OSX Command Line Tools.
xcode-select --install
- Install ChefDK.
- NOTE: Due to some gem dependencies that have not been updated for Chef 13 compatibility, the latest version of the
ChefDK found to work with
beckmanshire-chef
isv1.6.11
.
- NOTE: Due to some gem dependencies that have not been updated for Chef 13 compatibility, the latest version of the
ChefDK found to work with
- Generate an SSH key pair for the target machine (required for GitHub access to
beckmanshire
homesick repo). After creation, add the public key to GitHub.- NOTE: This key should be generated without a passphrase so the
chef-client
can successfully clone a git repository without being prompted for a passphrase.
- NOTE: This key should be generated without a passphrase so the
ssh-keygen -t rsa -b 4096 -C "your_email@your_domain.com"
cat .ssh/id_rsa.pub
- If your target machine is a VM, create a VM snapshot.
beckmanshire-chef is dependant on the cookbooks defined in this repository as well as some community cookbooks from
supermarket.chef.io. From your host machine, run the following command to gather all
necessary dependencies locally. The following command will download all cookbook dependencies to /berks-cookbooks
.
berks install && berks vendor --delete
From your host machine, run the following command to copy the beckmanshire-chef contents to the target machine.
rsync -r . [username]@[target-machine]:~/.chef_zero
To make the setup and execution of the chef-client
easier and more efficient on target machines, a shell script is
included in this project that contains the necessary command line execution options. The only prerequisite for using
this script is to ensure that any node JSON definition included in /nodes
is named with the target machines's
hostname value. For example: nodes/kbeckman-macbook.local.json
./.chef_zero/chef_client.sh
NOTE: Occasionally the chef-client tends to fail during the execution when it's running homebrew cask installations. If/when that happens, simply rerun the command to continue the process. All of the Chef commands are idempotent and are designed to be executed multiple times.