Skip to end of metadata
Go to start of metadata
Content Moved

This content has moved to http://www.opscode.com/chef/install/, but is being retained for legacy purposes.

 

 


These directions describe the Omnibus method of installing Chef client on a node running Linux or OS X.

Nodes are hosts whose configuration that you want to manage using Chef.


In general, installing Omnibus chef-client on a node includes:

  • Installing Embedded Ruby and Other Embedded Dependencies
  • Installing Chef
  • Configuring Chef

 

Omnibus Installation

The Chef Full Installer has been tested with Debian, Ubuntu, CentOS, RHEL, Fedora, Oracle Linux, Scientific Linux, and OS X.

You can install it by entering this command:

Once it is installed there will be no icon for it. If needed, you can confirm it was installed correctly with these commands in a new command prompt window:

You should see "10.18.0" returned as the version number.

Get the error "Could not find RubyGem chef" instead?


If you get an error that looks similar to the one below, it may be caused by having RVM installed with its own copy of the chef gem, separate from the Omnibus installation.

This can occur because RVM's chef-client binary appears before the Omnibus version in your $PATH (identified by running `which chef-client`), but using `sudo` or `sudo -s` can leave RVM in a half-loaded state, as /etc/profile.d/rvm.sh does not get loaded. To continue using the Omnibus version, use the absolute path of `/opt/chef/bin/chef-client`. To use the RVM version, use `sudo -i`, or source /etc/profile.d/rvm.sh before running chef-client.

Upon installation, this script will:

  • Install all of the embedded dependencies for Chef
  • Install an embedded version of Ruby and Rubygems
  • Install chef-client and knife version 10.18.0

After installation, you should move your validation client's private key onto the node and copy it to /etc/chef/.

 
Commands Run as Root

Commands that require root privileges are run with sudo in these directions. If your system is not configured to use sudo, run these commands as root using a method appropriate for your configuration.

 

System Requirements


Chef-client is supported on the following platforms

  • Ubuntu (10.04+)
  • Debian (5.0, 6.0)
  • RHEL & CentOS (5.x, 6.x)
  • Fedora 10+
  • openSUSE (12.1+)
  • SLES 11 SP2
  • Solaris 9,10,11 Sparc
  • Solaris 10,11 (x86 and x64)
  • Mac OS X (10.4, 10.5, 10.6, 10.7)
  • Windows 7
  • Windows Server 2003 R2, 2008 R2

Additionally, chef-client is known to run on the following platforms

  • Ubuntu (6.06, 8.04-9.10)
  • RHEL & CentOS (5.x)
  • Gentoo (11.1,11.2)
  • FreeBSD (7.1)
  • OpenBSD (4.4)
  • OpenSolaris (2008.11)
  • Solaris 5.10 (u6)
  • Windows Vista

 

 
 

Configure chef-client

The initial configuration of a chef-client requires a client.rb configuration file and a validation.pem file to be placed in /etc/chef. At a minimum client.rb must contain the configuration settings necessary for chef-client to communicate with chef-server. validation.pem is the permission certificate for your validator client. This API client is used on the first-run of chef-client and is used to create a new API client for the node. To create these we do the following:

  1. Create /etc/chef:

  2. Create client.rb and validation.pem:

    If you have a properly configured workstation, you should be able to run the following command from your workstation's chef repository

    This will place client.rb and validation.pem in your current working directory on your chef workstation. You can then use scp or another method to move both files into /etc/chef on the node you are configuring.

    If you do not have a configured workstation, you should create a minimal /etc/chef/client.rb. If you are using your own chef-server client.rbshould look as follows (substituting the correct address of your chef server):

    client.rb

    If you are using Hosted Chef, client.rbshould look as follows (with ORGNAME replaced with your Organization Short Name}}:

    client.rb for Hosted Chef

    If you are using an open source Chef 10 or earlier server, client.rb should look as follows:

    client.rb for Chef 10



    Your validation.pem can be downloaded from your chef-server if you are running your own chef-server. On your Chef Server, validation.pem should be in /etc/chef/. Users of Hosted Chef can find their validator client's key from the Hosted Chef Management Console. Note that if you are using Hosted Chef, your key is named ORGNAME-validator.pem.

Chef client has a number of configuration settings that do not appear above. See Chef Configuration Settings for further details.

Bootstrap

It is often easiest to install Chef on a node using knife-bootstrap. Bootstrapping runs a script on the target system which install Ruby, install chef-client, configure chef-client, and start a chef-client run. This method requires the node to be accessible over SSH. In most cases, bootstrapping a new node will be as simple as running a single command. For instance, to bootstrap a Linux workstation using the Omnibus installation method you might run the following command:

See Knife Bootstrap and Launch Cloud Instances with Knife for complete documentation. The bootstrap scripts distributed with knife for Ubuntu use an install method similar to the installation methods above.


Omnibus Information

There are a few ways that the Omnibus install is different from installing through rubygems or your OS's packaging system such as 'yum' or 'apt'.

Tested Operating Systems

Omnibus will work to install Chef on many Linux operating systems and OS X. It has been tested with Debian, Ubuntu, CentOS, RHEL, Fedora, Oracle Linux, Scientific Linux, and OS X. You can find information on installing the Windows version of Omnibus on the Installing Chef Client on Windows page.

Omnibus Packaging

The Omnibus installers are built using the same Ruby based Open Source project we use for packaging Private Chef. A couple of the installers are built with older build systems, and we plan to migrate them in the coming months. We also expect to add more platforms in the future.

Omnibus wraps itself in a package specific to your distribution where possible, such as a deb or rpm, so you can easily manage it using the tools you’re familiar with. If you prefer regular packages or installing from Rubygems for policy or personal reasons, you can find links to those directions on the Installing Chef Client and Chef Solo page.

Embedded Ruby and Other Dependencies

The Omnibus installer includes the Chef client, a stable version of Ruby, and everything else needed for Chef to run, in a single package. The dependencies are all carefully embedded so they won’t conflict with other versions of the same software on your system. Because you are also using an embedded version of rubygems you'll want to use a command like "sudo /opt/chef/embedded/bin/gem install knife-PLUGIN" to install any knife plugins on an Omnibus workstation.

Chef_gem and Gem_package resources

Because Omnibus includes its own version of Rubygems, it is important that you correctly use the gem_package and chef_gem resources. The gem_package resource is for installing a gem package to your system, whereas the chef_gem resource is for install a gem for use inside a chef recipe. Additional information is available on the Resources wiki page.



 

 


 


Installing Chef Client and Chef Solo

 


Upgrade Instructions

 

Labels
  • None