How I’m Learning Chef Configuration Management
A Beginner's Guide to Chef

Search for a command to run...
A Beginner's Guide to Chef

No comments yet. Be the first to comment.
EC2, or Elastic Compute Cloud, is AWS’s way of renting someone virtual servers in the cloud. What used to be in-house server stacks are now available in the cloud as EC2 instances. Just like normal servers, EC2 instances can be pre-configured to have...

For the next couple of months I’ve decided to focus on AWS and cloud computing. Seeing as AWS is the backbone of many DevOps tasks, getting a good grasp on the fundamentals will give me the tools I need to succeed in my position. As any engineer thes...

There are many reasons to become more proficient with bash scripting including becoming a more efficient cloud developer, typing faster than you can click on a GUI, and debugging more easily - just to name just a few. Part of navigating bash scriptin...

Working from home has its perks. One of them is blasting music as loudly as you want without worrying about bothering your coworkers. For me, music helps me stay focused while also bringing a little excitement throughout my day. When you fix that bug...

Chef is a configuration management tool. Configuration management tools are used in DevOps to help create powerful systems that enable continuous deployment. Configuration management tools like Chef manage certain entities like infrastructure and code.
Configuration management tools are useful in DevOps because they allow for quick fixes and configuration changes for servers. Rather than updating tens or hundreds of servers with a few lines of code, Chef allows you to write code once and deploy to as many servers as you need. This is a critical point for efficient continuous deployment.
Chef is set up with 3 different points of architecture. There’s the Workstation, the Server, and the Nodes. Each one plays a specific role in how your whole system gets the configurations it needs to keep deployments continuous.
But before we dive into the architecture, it’s important to understand the file structure of Chef. Chef at its core is written in Ruby and Erlang, but all the configurations you will end up writing will be in Ruby. These configuration files are called recipes. A collection of recipes is called a cookbook.
Now, back to the architecture.
The Workstation is your computer or the computer you might have remote access/ssh access to. This is the place where the recipes and cookbooks are updated and deployed with Chef’s CLI tool knife. Knife pushes your changes to the Server.
The Server is responsible for holding the source of truth for all the Nodes. So it contains the finished recipes and cookbooks that you have deployed to it. It won't contain any new changes or updates until you deploy those from your Workstation to the Server.
The Nodes are the individual servers that are running your services or applications. These Nodes use a tool called OHAI to check their state against the Server. If there is a difference in the state between the Nodes and the Server, chef-client is used to update the Nodes with whatever changes are needed from the Server. Oftentimes chef-client is set up with cron to run at a certain time every day or at certain time intervals, like every 30 minutes.
I used this video to understand what Chef is and how I can start using Chef today:
Additionally, since Chef recipes are written in Ruby, I’m taking this course on the basics of Ruby: