Book Image

Configuration Management with Chef-Solo

By : Rahman
Book Image

Configuration Management with Chef-Solo

By: Rahman

Overview of this book

This is a step-by-step guide, full of hands-on examples of real-world deployment tasks. Each topic is explained and placed in context, while also pointing out the key details of the concepts used. This book is aimed at system administrators and system engineers who have an understanding of configuration management tools and infrastructure. For novice administrators, it contains easy-to-use application recipes to get started immediately.
Table of Contents (8 chapters)

Resources


Resources are a key part of a recipe; they define which action needs to be taken, which files need to be created, and which service needs to be restarted. Resources are responsible for taking any particular action on a node. They are written in a small block of Ruby code that runs sequentially as defined in the recipe. The chef-client looks for a resource, and on successful execution of the resource, it will return the success code to the chef-client. In case of any error, chef-client will terminate the operation and display an error.

As our new machine is ready, let's use some resources and install some basic packages. We will install the vim and screen packages on our new machine. The vim package is used for editing any document, whereas the screen package is a multiplexer that allows a user to start multiple tasks inside a single terminal.

Primarily, a resource has four components: type, name, attributes with values, and action. Most of the time, attributes have default values...