Chef

Installation

Omnibus Chef

By Package

Install the omnibus-chefAUR package from AUR. If not using an AUR helper, first install the needed dependency, ruby-bundlerAUR.

This package builds and installs an omnibus Makeself installer for Chef. If you choose not to run the installer upon installation of the package, you can run it any time:

# /usr/local/bin/chef-installer

From Source

 $ git clone https://github.com/opscode/omnibus-chef.git
 $ cd omnibus-chef

Wipe out any previous installations and the omnibus cache:

# rm -Rf /opt/chef/* /var/cache/omnibus/*

Set up the directories and change the ownership to yourself so building as root is not required:

# mkdir -p /opt/chef /var/cache/omnibus
# chown -R "$USER:users" /opt/chef
# chown -R "$USER:users" /var/cache/omnibus

Run the following to build:

$ bundle install --binstubs
$ bundle exec omnibus clean chef
$ bundle exec omnibus build chef

After you may like to change ownership back of the system locations used:

# chown -R root:root /opt/chef
# chown -R root:root /var/cache/omnibus

A Makeself portable installer will be created, e.g. chef-11.8.2_0.arch.3.12.6-1-ARCH.sh. Run this executable to install chef.

Uninstallation

Remove all installation files manually:

# rm -Rf /opt/chef

You can also ensure the omnibus cache is removed:

# rm -Rf /var/cache/omnibus

RubyGem

This is one of easiest ways to install Chef, however if you already have gem versions of the dependencies installed you could run into conflicts.

Ensure you first install the ruby package from the official repositories. This also provides RubyGems.

Next, install the Chef RubyGem:

 # gem install chef

Package

Note: This section suggests using out-of-date packages and placing them in IgnorePkg. The method is not an Arch Linux best practice. Because of the upstream source requiring old packages, it is recommended to use the omnibus install (see above).

A number of RubyGem dependencies of Chef are older than the latest versions available.

First, build and install the known old versions from the dependency tree:

  • ruby-mime-types[1] (1.25)
  • ruby-net-ssh-multi[2] (1.1)
  • puma[3] (1.6.0)

Also for their dependencies:

  • ruby-moneta[4] (0.6.0) needed by chef-zero
  • ruby-systemu[5] (2.5.2) needed by ohai

Add each of the packages to IgnorePkg in /etc/pacman.conf, e.g.:

 IgnorePkg    = ruby-mime-types net-ssh-multi puma ruby-moneta ruby-systemu

Lastly, install the chefAUR package from AUR.