Book Image

Configuration Management with Chef-Solo

By : Naveed ur Rahman
Book Image

Configuration Management with Chef-Solo

By: Naveed ur Rahman

Overview of this book

Table of Contents (13 chapters)


Chef-Solo is an open source version of chef-client originally developed by Chef Software, Inc. It is a complete framework to automate infrastructure operations for building servers or applications from scratch or adding new configurations to existing systems. These servers are managed by code written in Ruby and it also provides the facility to test and reproduce.

The book will take the reader through the workflow of managing one or more servers. Also, it includes many sample recipes to help you get started.

Throughout the process, we will have a look at the different interaction points and you will learn how Chef-Solo helps to minimize your efforts to build and efficiently manage different machines. You will be able to handle one or more servers from the code written in Ruby. This book will also help you to understand the need for a configuration management tool and an in-depth explanation of Chef-Solo.

This book will provide clear instructions to the reader on how to convert your infrastructure into code. Also, it explains different virtual machines and certain deployment automation tools including Vagrant and Docker.

What this book covers

Chapter 1, Introduction to Chef and Chef-Solo, explains about Chef, chef-client, and Chef-Solo. It explains about the core concepts in Chef and the terminologies with some use cases.

Chapter 2, Setting Up an Environment for Chef-Solo, guides you to install Chef-Solo on your Ubuntu machine, and discusses cookbooks and their structure in detail. It also provides step-by-step instructions on how to run cookbooks using Chef-Solo with custom configurations.

Chapter 3, Setting Up a Development Environment, explains virtual machines and their providers. In this chapter, we will set up the development environment using Vagrant and execute some sample recipes.

Chapter 4, Developing Cookbooks, looks deeper into developing recipes and how to manage the recipes in cookbooks. It also provides more detailed information on metadata, attributes, templates, files, resources, and data bags. Also, it includes some tools to manage and create cookbooks, for example, Knife and Berkshelf.

Chapter 5, More about Cookbooks and Recipes, continues with the last chapter's cookbooks and manages the remaining contents with files and templates. This chapter includes Python/Django cookbooks and information about upstream service.

Chapter 6, Chef-Solo and Docker, covers the installation of Docker and creation of Docker images using Chef-Solo. Also, this chapter includes some recommendations on how to work on recipes of ongoing projects and keep them aligned with Chef-Solo.

What you need for this book

You need only a single Ubuntu machine to get started. This book contains a step-by-step guide to set up a development environment. Once you have successfully installed everything, you can easily reproduce the same on multiple machines.

Who this book is for

This book is for system administrators and system engineers who have an understanding of configuration management tools and infrastructure. It helps you to understand the need for these tools and provides you with a step-by-step guide to maintain your existing infrastructure. It also contains the most frequently used application recipes to get started immediately.


In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The solo.rb file is used to specify all the configuration details."

A block of code is set as follows:


When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

# To update
execute "update apt" do
  command "apt-get update --fix-missing"

Any command-line input or output is written as follows:

$ sudo apt-get install curl

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "It should display the Welcome to nginx! page."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from


Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.


You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.