Configuration Management with Chef

This year I’m doing my internship at Kartaca on product and system management. One of the things I’m working on is Chef. I have learned a lot about Chef, even though I had some difficulties. But, I think it is essential to review some of the things I learned before I forget them and share my knowledge. So I explain what Chef is, how it works, how to set it up, and what cookbook is. If you see anything wrong, please do send me your comments. After all, I am still learning. Now let’s see what the Chef is.
What is Chef?
Wikipedia says, “Chef is the name of a configuration management tool written in Ruby and Erlang. Chef is used to streamline the task of configuring and maintaining a company’s servers.”
And why is this a problem that needs to be solved?
- Continuous infrastructure changes, especially in the cloud systems
- Various operating systems
- Various hardware produced by brands
- Different applications in the stack
What exactly can you do with Chef?
- You can install/uninstall servers supported by Chef
- You can install an operating system on new servers
- You can install applications on servers
- You can configure a new app to suit its environment
What are the main building blocks of Chef?
- Environments
- Nodes
- Cookbooks
- Recipes
- Files/templates
- Attributes
- Data Bags
- Search and more
What do we understand from this picture?
- Chef has many layers: environment, node, role, cookbook
- Chef groups the nodes within the boundaries of the environment
- Nodes have one or more roles.
- Role is a combination of one or more cookbooks.
- Cookbooks consist of a combination of many recipes, templates, and files.
Chef has three integral components:
- Chef-server
- Chef-client that manages the nodes
- Workstation where system admin manages the chef-server and chef-client
As is evident from the picture, we edit cookbooks or settings in the workstation and send them to the Chef server via the Knife. The Chef client takes configuration information from the server at the specified runtime and applies them to the nodes.
What is Knife?
It is a command-line tool for establishing a connection with the server from the workstation. Knife allows users to control nodes, cookbooks, roles, environments, and data links.
In the next blog post, I will write about defining the nodes with chef-server and chef-client installations. It has been the most challenging part for me, and I’m still unsure if I’ve figured it out.
Finally, I’ll share some links to learn Chef, although they would be the first links to come up on Google.
1. http://docs.opscode.com/ This is the official documentation. It didn’t help much with the installation, but I liked the problem-solving part.
2. http://learnchef.getharvest.com/introduction.html One of the resources I used for writing this blog post.
3. http://webchat.freenode.net/?channel=chef #chef channel on IRC