Table of contents
1.
Introduction 📝 
2.
About Chef Workstation 🎫
2.1.
Getting Started
2.2.
Cookbook Development Workflow
2.3.
Tools
3.
Install Chef Workstation  🎛️
3.1.
Supported Platforms 
3.2.
System Requirements
3.3.
Installation of Chef Workstation
3.4.
macOS Install
3.5.
For Windows Install
3.6.
For Linux Os
3.7.
Upgrading Chef Workstation 
3.8.
Uninstalling Chef Workstation  
3.8.1.
Mac Uninstall 
3.8.2.
Windows Uninstall OF Chef Workstation
3.8.3.
Linux Uninstall of Chef Workstation:
4.
Set Up Chef Workstation 🌐
4.1.
Configure Ruby Environment
4.2.
Set up Your Chef Repo
5.
Configure Chef Workstation 🖥️
5.1.
Default location 
5.1.1.
For Windows Os
5.1.2.
For Linux and Mac Os
5.2.
Settings 
5.2.1.
Telemetry 
5.3.
Cache 
5.3.1.
Example 
5.3.2.
Path for Configure Chef Workstation
6.
Troubleshooting ⚙️
6.1.
Chef Workstation Logs 
6.2.
Uninstall instructions 
7.
Privacy and Telemetry 🎯
7.1.
What Chef Workstation Collect
7.2.
How Chef Workstation Uses Your Data
7.3.
Opting out 
7.4.
See Your Data
8.
Frequently Asked Question❓
8.1.
What is a Chef workstation?
8.2.
What is Chef in DevOps?
8.3.
What is Chef infra used for?
8.4.
What are the minimum system requirements for Chef Workstation?
8.5.
What is the chef workstation includes?
9.
Conclusion ✉️
Last Updated: Mar 27, 2024
Easy

Overview of Chef Workstation

Author Alok Pandey
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction 📝 

In this blog, we will discuss the Overview of the Chef Workstation. Chef is a corporation that specializes in automation. Since its launch in 2008, they have brought developers and system administrators together with our eponymous product, Chef Infra. Many features make the chef infra uniques. 

Overview of Chef Workstation

About Chef Workstation 🎫

Chef Workstation includes everything you need to get started with Chef, including ad hoc remote execution, remote scanning, configuration tasks, recipe writing tools, and sophisticated dependency and testing software, all in a single, simple-to-install package.

Chef Workstation includes the following packages:

  • Chef Infra Client
     
  • Chef Habitat
     
  • Chef InSpec
     
  • Testing tools such as Test Kitchen and Cookstyle
     
  • chef and knife command line tools
     
  • Everything else needed to author cookbooks and upload them to the Chef Infra Server

Getting Started

Chef Infra is a framework for system and cloud infrastructure automation that makes it simple to deploy servers and apps to any physical, virtual, or cloud location, regardless of infrastructure size. Each organization is made up of one (or more) Chef Workstation installations, a single server, and every node that Chef Infra Client will configure and maintain. Cookbooks (and recipes) are used to instruct Chef Infra Client on how to configure each node in your business. The actual setup is handled by the Chef Infra Client, which is installed on each node.

Cookbook Development Workflow

Chef Infra establishes a standard methodology for cookbook development:
 

  1. Create a skeleton cookbook by running chef generate cookbook COOKBOOK_NAME.  This creates a cookbook with a single recipe and a testing configuration for Chef InSpec Test Kitchen.
     
  2. Cookstyle and Test Kitchen are used to lint and debug cookbook recipes and resources. Making your own cookbooks is an iterative process that involves developing, testing, finding, and fixing errors, and then developing and testing again. To write your cookbooks, all you need is a text editor—Visual Studio Code, Atom, vim, or any other chosen text editor.
     
  3. Acceptance testing. Test your work in a setting similar to your production environment.
     
  4. Deploy your cookbooks to the production environment only after they have passed all of the acceptance tests and have been validated to perform as expected.

Tools

Chef Workstation includes all of the tools required for success with Chef Infra and InSpec. These utilities are packaged for popular operating systems and include all of the dependencies required to get started.

Tool

Description

Chef CLI A tool for the Chef Infra workflow.
knife A system management tool for the Chef Infra Server.
Chef Infra Client The Chef Infra agent.
Chef InSpec A compliance as code testing tool that also works with Chef Infra Recipes
Cookstyle A linting tool that improves the quality of your Chef Infra cookbooks by identifying and fixing any style, syntax, and logic errors in your code.
Test Kitchen A framework for integration testing that can test recipes on many platforms and with different cloud services and hypervisors.

 

Install Chef Workstation  🎛️

Supported Platforms 

Supported Host Operating Systems:

Platform

Version

Amazon Linux 2
Apple macOS 10.15, 11, 12
Windows 10, 11, Server 2012, Server 2012 R2, Server 2016, Server 2019, Server 2022
Red Hat Enterprise Linux / CentOS 7.x, 8.x
Ubuntu 16.04, 18.04, 20.04
Debian 9, 10, 11

System Requirements

Minimum system requirements:

RAM: 4GB

Disk: 8GB

Extra memory and storage space may be required to use Chef Workstation capabilities like Test Kitchen, which develops and manages virtualized test environments.

Additional Chef Workstation App Requirements:

On Linux, you must be running a graphical window manager that supports system tray icons. Additional libraries may be required for some distributions. The post-install notice will tell you which, if any, additional libraries are necessary to run the Chef Workstation App after you install the Chef Workstation package from the terminal.

Installation of Chef Workstation

The Chef Workstation installer must run as a privileged user.

Chef Workstation is installed under /opt/chef-workstation/ on macOS and Linux, and in C:\opscode\chef-workstation\ on Windows. These file locations aid in avoiding conflict between these components and other applications operating on the target machine.

macOS Install

  1. Select the right package for your macOS version from the Chef Workstation downloads page. Click the Download button.
     
  2. Accept the license and install the Chef Workstation by following the procedures.
     
brew install --cask chef-workstation

For Windows Install

  1. Visit the Chef Workstation downloads page and select the appropriate package for your Windows version. Click on the Download button.
     
  2. Accept the license and install the Chef Workstation by following the procedures. You will be able to alter the installation location; by default, the installer will use the C:\opscode\chef-workstation\ directory.
     

Alternately, You can install Chef Workstation using the Chocolatey package manager:

choco install chef-workstation

For Linux Os

  1. Visit the Chef Workstation downloads page and download the appropriate package for your distribution:
     

Debian/Ubuntu

wget https://packages.chef.io/files/stable/chef-workstation/21.10.640/ubuntu/20.04/chef-workstation_21.10.640-1_amd64.deb

 

Red Hat Enterprise Linux

wget https://packages.chef.io/files/stable/chef-workstation/21.10.640/el/8/chef-workstation-21.10.640-1.el8.x86_64.rpm

 

2. Use your distribution package manager to install Chef Workstation:
 

Debian/Ubuntu:

dpkg -i chef-workstation_21.10.640-1_amd64.deb

 

Red Hat Enterprise Linux:

yum localinstall chef-workstation-21.10.640-1.el8.x86_64.rpm

 

To verify the installation of Chef Workstation, run:

chef -v

 

OUTPUT

Chef Workstation version: 21.10.640
Chef Infra Client version: 17.6.18
Chef InSpec version: 4.46.13
Chef CLI version: 5.4.2
Chef Habitat version: 1.6.351
Test Kitchen version: 3.1.0
Cookstyle version: 7.25.6

Upgrading Chef Workstation 

To upgrade from ChefDK or an earlier release of Chef Workstation, follow the instructions provided under Installing.

Uninstalling Chef Workstation  

Mac Uninstall 

Run uninstall_chef_workstation in your terminal.

Windows Uninstall OF Chef Workstation

Use Add / Remove Programs to remove Chef Workstation.

Linux Uninstall of Chef Workstation:

 

Ubuntu, Debian, and related:

sudo dpkg -P chef-workstation

 

Red Hat, CentOS, and related:

sudo yum remove chef-workstation

Set Up Chef Workstation 🌐

In this section of the article, we will see how to setup Chef Workstation:

Configure Ruby Environment

Ruby is largely utilized by many users to create Chef policies (for example, cookbooks, Policy files, and Chef InSpec profiles). If this is the case, we propose setting the Chef Workstation Ruby as your default system Ruby. You should skip this step if you use Ruby for software development.

Note: These instructions are designed for users of macOS and Linux. On Windows, Chef Workstation features a desktop shortcut to a pre-configured PowerShell prompt.

Determine your default shell by running:

echo $SHELL


The output will give you the path to your default shell such as /bin/zsh for the Zsh shell. 

Add the Workstation initialization content to the appropriate shell rc file:
 For Bash shells run:

echo 'eval "$(chef shell-init bash)"' >> ~/.bashrc

 

For Zsh shells run:

echo 'eval "$(chef shell-init zsh)"' >> ~/.zshrc

 

For Fish shells run:

echo 'eval (chef shell-init fish)' >> ~/.config/fish/config.fish

 

Open a new shell window and run:

which ruby


The output should return /opt/chef-workstation/embedded/bin/ruby.

Set up Your Chef Repo

If you are implementing Chef for the first time in your business, you will require a Chef Infra repository to save your cookbooks and other work.

The chef-repo is a directory on your workstation that contains all of the files required to define your infrastructure with Chef Infra:

  • Data bags
     
  • Cookbooks (including recipes, attributes, custom resources, libraries, and templates)
     
  • Policyfiles
     

You can visit the official docs of the Set Up Chef Workstation for more information.

Configure Chef Workstation 🖥️

Chef Workstation App and chef-run configuration are set up in config.toml.  The first time you use chef-run, Chef Workstation will build config.toml if it doesn't already exist. Visit the relevant sites listed in the toolbar under Chef Workstation Tools to configure any additional tools.

Default location 

Chef Workstation looks for the config.toml in a default location.

For Windows Os

Powershell: 

$env:USERPROFILE\.chef-workstation\config.toml


cmd.exe: 

%USERPROFILE%\.chef-workstation\config.toml

For Linux and Mac Os

/home/$USER/.chef-workstation/config.toml

Settings 

Telemetry 

Configure telemetry behaviors for Chef Workstation components.

[telemetry]
enable = true
dev = false

Cache 

Configure caching options.

Example 

[cache]
path = "/home/users/username/.cache/chef-workstation"

Path for Configure Chef Workstation

Description

The base path is used to store cached cookbooks and downloads.

Default

$USERHOME/.chef-workstation/cache


Values

This must reference a valid, writable directory.

Used by

chef-run


You can visit the official docs of Configure Chef Workstation for more information.

Troubleshooting ⚙️

Troubleshooting is an important task in any software development process. And we generally check the log to troubleshoot the problem.

Chef Workstation Logs 

Chef Workstation logs are stored in ~/.chef-workstation/logs.

Uninstall instructions 

Follow the steps provided under Uninstalling.
You can visit the official docs of the Chef Infra Search for more information.

Privacy and Telemetry 🎯

We gather data to aid in the detection of issues and an understanding of user behavior in order to continuously enhance the Chef Workstation.

What Chef Workstation Collect

  • A distinct installation id that is unrelated to user information. As a result, we can count the active Chef Workstation installations without using IP-based tracking.

 

  • You run the Chef-specific instructions, but none of the arguments you supply are used.

 

  • Operating system and version used on your host.

 

  • Any hostname you're connected to using chef-SHA256 run's sum.

 

  • How to use WinRM or SSH to connect to a remote host using chef-run.

 

  • The operating system of the hosts that the chef-run is connecting to as the target.

How Chef Workstation Uses Your Data

Using this information, Chef Workstation can watch user behavior, find errors, and refine programming based on actual user feedback.

Your information is only accessible to employees of Chef Software, Inc. Your data will never be shared, sold again, or used maliciously by us.

Opting out 

  • To stop the capture of telemetry data from a single session, set the environment variable CHEF_TELEMETRY_OPT_OUT to any value before running chef-run
     
CHEF_TELEMETRY_OPT_OUT=1 chef-run -h

 

  • Disable telemetry entirely by adding the following to $HOME/.chef-workstation/config.toml:
     
[telemetry]
enabled=false

See Your Data

You can view the analytics Chef Workstation collects before it is sent. In the HOME/.chef-workstation/telemetry/ folder, locate and delete your data. The information from a recent chef-run is saved in the telemetry folder and gathered at the beginning of the subsequent chef-run.

Check out this problem - Smallest Distinct Window.

Frequently Asked Question❓

What is a Chef workstation?

Chef Workstation is Chef's modern developer toolkit, which contains Chef Infra, InSpec, and Habitat, as well as a slew of resources, helpers, and testing tools that make infrastructure, application, and security testing easier than ever before.

What is Chef in DevOps?

A guide for people new to DevOps With Chef, a DevOps program in your kitchen, becoming an expert in the cloud is much simpler. Chef is an open-source cloud deployment and configuration management tool. Anyone can use it to organize servers in a departmental data center or the cloud.

What is Chef infra used for?

A powerful automation platform called Chef Infra turns infrastructure into code. Whatever the size of your network, Chef Infra automates the configuration, deployment, and management of infrastructure across it, whether you're operating in the cloud, on-premises, or a hybrid environment.

What are the minimum system requirements for Chef Workstation?

Minimum system requirements for Chef Workstation RAM - 4Gb and Disc space 8GB.

What is the chef workstation includes?

Chef Workstation includes everything you need to get started with Chef, including ad hoc remote execution, remote scanning, configuration tasks, recipe writing tools, and sophisticated dependency and testing software, all in a single, simple-to-install package.

Conclusion ✉️

In this article, we have extensively discussed the Overview of the Chef Workstation. If you would like to learn more, check out our articles on
 

 

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. 

Enroll in our courses and refer to the mock test and problems available.

Take a look at the interview experiences and interview bundle for placement preparations.

Happy Coding!

Live masterclass