Workstation
A workstation can be defined as a system on which we have chef client installed, and which has knife configured properly. A workstation holds a local repository for chef server. It is a place where all the development work takes place, and then that work is uploaded to the chef server. It provides an interface to interact with the chef server. The main functions of a workstation can be
Before we start with the installation, we must make sure we meet the prerequisites required to install and configure a workstation properly.
For testing purposes we can use a t1.micro instance on AWS (Amazon Web Services) to run chef client. However, for a production client we should use instances with at least 2GB of RAM and 15GB of storage.
Table 4-1 lists the operating systems (OSs) that currently support chef client.
Table 4-1. List of Operating Systems That Support Chef Client
Operating System |
Version |
Architecture |
---|---|---|
Debian |
6 and above |
i686, x86_64 |
Enterprise Linux |
5.x, 6.x |
i686, x86_64 |
Mac OS X |
10.6, 10.7 |
x86_64 |
openSUSE |
12.1 |
i686, x86_64 |
Solaris |
5.9 |
Sparc |
|
5.10. 5.11 |
i386, sparc |
SUSE Enterprise |
11.2 |
i686, x86_64 |
Ubuntu |
10.04, 10.10, 11.04, 11.10, 12.04, 12.10 |
i686, x86_64 |
Windows |
2003 R2, 2008 |
i686, x86_64 |
|
2008 R2, 2012 |
x86_64 |
Install and Configure a Workstation
In order to configure a workstation properly, several steps are necessary. Here we demonstrate the configuration of a workstation on an Enterprise Linux-based OS. The same steps can be used to configure it on any other OS.
We cover each and every step in detail in the upcoming sections.
This step mainly includes identifying the OS, which will help us in installing the relevant package on the system.
Install the Chef Client Package
There are two options to install the chef client package.
Go to www.getChef.com/Chef/install/.
Visit the chef client tab and select your OS and its architecture. You will find two ways to install the package, as shown in Figure 4-1, and you can use either method to install the package. We demonstrate here by using the second method.
Figure 4-1. Downloading the chef package
Select the chef version and download it to the machine on which we will configure the workstation.
After downloading the installer, run it using a relevant method based upon your OS. For Windows, right-click and run as administrator and install (see Figure 4-2). For Enterprise Linux, download the rpm and install it.
Figure 4-2. Installing the chef package
Verify the installation by typing chef client –v at the command line. It should return something like what we see in Figure 4-3.
Figure 4-3. Verifying installation
Copy the Key Files from the Chef Server
The workstation needs some keys and configuration files to connect and authenticate with the chef server. The following items are required:
We demonstrate by configuring knife to an open source chef server. Run the knife configure command to configure the workstation and create the knife configuration file. Figure 4-4 shows this operation.
Figure 4-4. Configuring knife
The following inputs are required to configure knife:
Git is required on the workstation if we want to clone the repository on github provided by Opscode. If we don’t want to do so, then we can create our own chef repository. This step is an optional, required only if we want to clone the repository provided by chef.
Place the Knife Configuration and Key Files in the .Chef Directory
By default, Chef looks for the knife configuration in the .Chef directory (for Linux /root/.chef and for Windows c:/users/user/.chef). So, you need to place the following items in that directory:
Verify the Workstation Configuration
To verify that our workstation is properly configured we run a test command.
Knife client list.
The command will list all the clients registered with chef server. The output will be similar to what we see in Figure 4-5.
Figure 4-5. Verifying that chef is installed properly