Follow the instruction at http://docs.opscode.com/install_workstation.html
For the context of this note, we are assuming the use of Chef Open Source Server.
Chef Server must be installed and running before setting up a workstation. The administration user's private key is required. This key is shown at the first set up of the administration user. The chef-validator.pem is also required. This file can be copied from
scp [chef-server]:/etc/chef-server/chef-validator.pem .
The workstation needs to be able to resolve the location of the Chef Server. Make sure the DNS resolves the hostname correctly or add the host entry to /etc/hosts file.
sudo echo "xxx.xxx.xxx.xxx [chef-server-hostname]" >> /etc/hosts
The client workstation requires these packages prerequisites:
Chef installer will install its own version of Ruby so there is no need to install system ruby. rvm will not work with the installer.
Select the omnibus installer by visiting http://www.opscode.com/chef/install/ Use the Client tab. Select the correct OS, version, and architecture. Copy the command on the right hand side and paste to the terminal to run the installer script.
curl -L https://www.opscode.com/chef/install.sh | sudo bash
As of October 31, 2013, the omnibus installer is not yet available for Mac OS X 10.9 Mavericks.
Ensure the installation by checking the version of chef-client
chef-client -v
Clone the chef repository from git
# Change as needed CHEF_REPO=~/chef_repo git clone git://github.com/opscode/chef-repo.git $CHEF_REPO # Switch remote repo to point to the appropriate repository of your organization.
Create a .chef directory in the repository root and add it to .gitignore.
cd $CHEF_REPO
mkdir .chef
# edit .gitignore to include .chef
grep .chef .gitignore #=> should return 3 lines
# commit .gitignore as necessary
When the installation is done, create a configuration file with the command
cd $CHEF_REPO_ROOT/.chef
knife configure --initial
# answer the questions on screen provide proper path to the private key files and Chef Server URL.