Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Chef
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Chef

Mastering Chef

By : Mayank Joshi
2.5 (4)
close
close
Mastering Chef

Mastering Chef

2.5 (4)
By: Mayank Joshi

Overview of this book

If you have used Chef before and are interested in automation of infrastructure and want to develop your own tools to manage large-scale infrastructures, then this book is for you.
Table of Contents (15 chapters)
close
close
2
2. Knife and Its Associated Plugins
10
10. Data Bags and Templates
14
Index

What this book covers

Chapter 1, Introduction to the Chef Ecosystem, serves as a reference to new users of Chef. After a brief introduction, we jump into the anatomy of a chef-client run and at the end, we'll see how to go about setting up our workstation for the development of a Chef code that is thoroughly tested before being pushed to the production environment.

Chapter 2, Knife and Its Associated Plugins, introduces the reader to one of the most widely used tools in the Chef ecosystem, called Knife. We will learn to use Knife to bootstrap instances and also learn about different plugins that can be used to accomplish daily routine tasks in a more efficient way.

Chapter 3, Chef and Ruby, brings a user up to speed with the required Ruby knowledge, thereby allowing them to write a more efficient infrastructure code. By the end of this chapter, the user will be equipped with enough knowledge of Ruby to extend the code for infrastructure provisioning, beyond what can be accomplished by merely using the DSL provided by Chef.

Chapter 4, Controlling Access to Resources, introduces the concept of organization, groups, and users, and explains how you can allow fine-grained access to different types of objects residing on the Chef server.

Chapter 5, Starting the Journey to the World of Recipes, introduces the reader to the most fundamental unit of code written by Chef developers—"recipes". We'll learn about the different components of a recipe and get an understanding of the different resources that can be used to manage our infrastructure.

Chapter 6, Cookbooks and LWRPs, introduces users to cookbooks and how you can extend chef-client through the use of lightweight resource/provider. Readers will also learn how to create their own custom LWRPs by the end of this chapter.

Chapter 7, Roles and Environments, explains that, most of the time, a server is not just associated with one particular task and can perform many different operations. For example, you might have a web server that is also performing the role of an application server and a proxy. Roles allow users to attach multiple recipes to a server. Also, in most organizations, infrastructure is classified into different environments depending upon the use. For example, an organization might have a dev, QA, staging, and production environment. The configuration of applications running across these environments will be different to some extent. This chapter will explain what a role is, how we can group multiple recipes in a role, and how to use roles inside a recipe to do things conditionally. We'll also learn how you can manage different environments in your infrastructure using Chef.

Chapter 8, Attributes and Their Uses, explains that every service and a server can be identified with a role and set of properties associated with it. Some properties are system specific, such as the IP address, kernel, hostname, and so on. While they are necessary, an effective infrastructure code always needs more properties that can define the services and the server itself in a more precise manner. In this chapter, we'll see what the different types of attributes are and how to override values of the attributes.

Chapter 9, Ohai and Its Plugin Ecosystem, explains that as part of a chef-client run, many details related to the underlying system, such as architecture, operating system, network details, filesystem, and so on, are required to be collected by Chef. Ohai is a tool that allows for this. In this chapter, we'll learn about Ohai and its plugin-based architecture and associated plugins. We'll also learn how to write our own custom Ohai plugins.

Chapter 10, Data Bags and Templates, explains that in highly dynamic environments such as cloud, a configuration management system is only as good as its support for allowing the specification of the configuration in a form that is dynamic. Templates are just what the doctor ordered for this use case. Data bags, on the other hand, are data stores containing the data stored in a JSON format. In this chapter, we'll learn how to make effective use of databags and templates to define our infrastructure.

Chapter 11, Chef API and Search, explains that the Chef API is perhaps one of the most powerful features of Chef. Chef has a really wonderful API and its search facility is what makes it really fun to use. There are lots of cases where you can make use of Chef's API to build tools that can help in the efficient automation of the tasks. In this chapter, we'll look at Chef's API, using search in a recipe using Chef API, and also using a search through Knife.

Chapter 12, Extending Chef, covers the writing of a custom code suited for our requirements that will help us to extend the functionality of Chef. We'll learn how to write custom Knife plugins and custom Chef handlers.

Chapter 13, (Ab)Using Chef, explores some fun uses of Chef, which will allow an increase in productivity, while managing a large scale infrastructure. We'll see how we can extend tools such as Capistrano by using Chef API. We'll also learn how to manage large distributed clusters using an extension of Chef called Ironfan. We will also look at tools such as the Push Job server, which can be used for the orchestration of chef-client runs across a set of instances.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Chef
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon