In this tutorial, we will show you how to install Chef Workstation on CentOS 8. For those of you who didn’t know, A Chef is a configuration management tool that simplifies manual and repetitive tasks for infrastructure management. With the Chef users can easily manage, configure and deploy the resources across the network from the centralized location irrespective of the environment (cloud, on-premises, or hybrid).
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Chef Workstation on CentOS 8.
Prerequisites
- A server running one of the following operating systems: CentOS 8.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Chef Workstation on CentOS 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf clean all sudo dnf update
Step 2. Installing Chef Workstation on CentOS 8.
Now we download the latest release on the Chef Workstation releases page:
wget https://packages.chef.io/files/stable/chefdk/4.13.3/el/8/chefdk-4.13.3-1.el7.x86_64.rpm
Then, use the following rpm command to install Chef as shown:
rpm -ivh chefdk-4.13.3-1.el7.x86_64.rpm
To verify the installation, run:
$ chef -v Chef Workstation version: 0.9.31 Chef Infra Client version: 15.3.14 Chef InSpec version: 4.16.0 Chef CLI version: 1.0.13 Test Kitchen version: 2.3.2 Cookstyle version: 5.6.2
Next, we will validate the workstation with a simple recipe. Here, we are going to create a text file test.txt which should contain “Welcome to idr00t” using Chef.
nano idrootchef.rb
Add the following code:
file 'text.txt' do content 'Welcome to idr00t' end
Then, run the recipe using the below command:
chef-apply idrootchef.rb
Congratulations! You have successfully installed Chef Workstation. Thanks for using this tutorial for installing the Chef Workstation on CentOS 8 systems. For additional help or useful information, we recommend you check the official Chef website.