Chef is a configuration management tool for information technology (IT) professionals, like you. Because there are a wide variety of definitions for the term configuration management, let’s take a moment to explain what configuration management means in the context of this book and why you need a configuration management tool. We’ll also cover what Chef is, and why you need it as well.
With respect to IT, configuration management covers the set of engineering practices for managing the following entities involved in delivering software applications to consumers:
Configuration management came about to address the fundamental challenges involved in doing group work. Managing change when you are a lone system administrator with a handful of servers to manage is relatively straightforward. Trying to coordinate the work of multiple system administrators and developers involving hundreds, or even thousands, of servers and applications to support a large customer base is complex and typically requires the support of a tool.
A modern IT configuration management tool usually involves an implementation inspired by the automation and policy-based theory originally developed by Mark Burgess. He developed the following core ideas of this theory for automating IT when he was a professor at Oslo University College in the late 1990s and early 2000s:
Consistency. If your infrastructure is being configured manually, how do you know your servers are being set up in a consistent manner? Further, how do you know these changes are being performed in a way that meets your compliance and security requirements? (For instance, are administrators logging changes in the appropriate systems?)
Make life easier for your system administrators by automating repeated tasks with a configuration management tool. When repeated tasks are tedious, humans are alarmingly bad at performing them consistently. Automate tedious administration tasks with a configuration management tool so your staff can focus on other important things that humans do best.
Efficient change management. Whenever infrastructure is built manually without the aid of a configuration management tool, people tend to fear change. Over time, servers that are maintained by hand tend to become fragile environments that are hard to understand and modify.
In these situations, organizations tend to develop a lot of processes for managing changes, usually with the sole intent on minimizing change or even delaying it as long as possible. This tends to delay introducing new features your customers need.
When servers can be reproduced easily in a repeatable fashion, fewer processes are needed to manage change. Small change batches can be performed on a regular basis, such as daily, or even several times a day.
Simplicity in rebuild. When servers are built manually, it’s typically not easy to rebuild them from scratch. What would happen if you suddenly lost your servers in a catastrophic event? How quickly could you restore service if disaster struck?
Automated deployments using a configuration management tool help quickly restore service. Rather than bothering to upgrade or patch applications, which can be inherently fragile operations, system administrators can build a new, upgraded system in an automated fashion and throw the old one away, returning it to the server pool. When rebuilds are easy, system administrators gain confidence to make changes to infrastructure more rapidly.
Visibility. Configuration management tools include auditing and reporting capabilities. Monitoring the work performed by one system administrator doesn’t require a sophisticated tool. But trying to understand what is going on with a team of, say, 10 system administrators and 10 software developers deploying software changes many times per day? You need a configuration tool.
When infrastructure changes are handled by automated systems, changes can be automatically logged in all relevant tracking systems to raise visibility on the meaningful work your teams are doing.
Chef is an automation platform that configures and manages your infrastructure whether it is on-premises or in the cloud. You can deploy to the infrastructure type that makes the most sense for your business. You can use Chef to speed up application deployment, even creating a continual deployment pipeline. The key to Chef’s power is that it turns infrastructure into code.
Infrastructure as code means that your computing environment has some of the same attributes as your application:
Figure 1-1 presents an overview of the major components of Chef.
The components of the Chef Development Kit help support you as you write Chef code on your development workstation. Chef Server provides additional components to help scale your configuration management capabilities to hundreds or thousands of servers, and beyond.
Over time with community support, Chef has evolved to have a powerful set of features that make it unique among configuration management tools:
Chef’s unique approach gives you tremendous flexibility. You don’t need to struggle to conform to Chef. Chef adapts to you and your environment. You can deploy to the cloud or local infrastructure. You can describe any resource you have in code no matter how much it differs from a standard configuration.
With Chef there is no reason to start from scratch; many standard infrastructure configurations and tasks are already described in Chef cookbooks are available for free on the Chef Supermarket site.
Once you master Chef, you can use it to
As an example, Tom Hallet used Chef to create a tool called SoloWizard, which he uses to automate deployments of his Mac OS X development machines. SoloWizard is based on the work Pivotal Labs has done to promote the use of automation for developer and end-user systems. As you can see from Figure 1-2, SoloWizard lets you create a new development environment with a single command. You can even personalize the output script to meet your needs by making choices on a simple website. This tool is publicly available at the SoloWizard site.
In the first half of this book, we’ll cover all the essential components of client-side Chef, showing you how to make your infrastructure versionable and repeatable with code. We’ll cover:
We’ll also give you a firm foundation in the basics of infrastructure coding with Chef by providing lots of hands-on examples.
In the second half of this book, we’ll introduce you to the essential topics related to Chef Server, showing you how to make your configuration management abilities scale as your infrastructure increases in complexity and scope:
Tools covered in this book are freely available as open source downloads. Some paid tools will be mentioned, but are not required to learn or use Chef.