Book Image

Chef Infrastructure Automation Cookbook

By : Matthias Marschall
Book Image

Chef Infrastructure Automation Cookbook

By: Matthias Marschall

Overview of this book

<p>Irrespective of whether you're a systems administrator or a developer, if you're sick and tired of repetitive manual work and not knowing whether you may dare to reboot your server, it's time for you to get your infrastructure automated.</p> <p>Chef Infrastructure Automation Cookbook has all the required recipes to configure, deploy, and scale your servers and applications, irrespective of whether you manage 5 servers, 5,000 servers, or 500,000 servers.</p> <p>Chef Infrastructure Automation Cookbook is a collection of easy-to-follow, step-by-step recipes showing you how to solve real-world automation challenges. Learn techniques from the pros and make sure you get your infrastructure automation project right the first time.</p> <p>Chef Infrastructure Automation Cookbook takes you on a journey through the many facets of Chef. It teaches you simple techniques as well as fully fledged real-world solutions. By looking at easily digestible examples, you'll be able to grasp the main concepts of Chef, which you'll need for automating your own infrastructure. Instead of wasting time trying to get existing community cookbooks running in your environment, you'll get ready made code examples to get you started.</p> <p>After describing how to use the basic Chef tools, the book shows you how to troubleshoot your work and explains the Chef language. Then, it shows you how to manage users, applications, and your whole cloud infrastructure. The book concludes by providing you additional, indispensable tools and giving you an in-depth look into the Chef ecosystem.</p> <p>Chef Infrastructure Automation Cookbook will help you learn the techniques of the pros by walking you through a host of step-by-step guides to solve real-world infrastructure automation challenges.</p>
Table of Contents (15 chapters)
Chef Infrastructure Automation Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using custom bootstrap scripts


While creating a new node, you need to make sure that it has Chef installed on it. Knife offers the bootstrap subcommand to connect to a node via Secure Shell (SSH) and run a bootstrap script on the node.

The bootstrap script should install Chef Client on your node and register the node with your Chef Server. Opscode comes with a few default bootstrap scripts for various platforms. There are options to install Chef Client using the Opscode Omnibus installer, packages, or Ruby gems.

If you want to modify the way your Chef Client gets installed on your nodes, you can create and use custom bootstrap scripts.

Let's have a look how to do this.

Getting ready

Make sure you've a node ready to become a Chef Client and can SSH into it. In the following example we'll assume that you'll have a username and password to log in to your node.

How to do it...

Let's see how to execute our custom bootstrap script with Knife to install Chef Client on our node:

  1. Create your basic bootstrap...