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

Setting up SNMP for external monitoring services


Simple Network Management Protocol (SNMP) is the standard way to monitor all your network devices. You can use Chef to install the SNMP service on your node and configure it to match your needs.

Getting ready

Make sure you've a cookbook named my_cookbook and run_list of your node includes my_cookbook as described in the Creating and using cookbooks section in Chapter 1, Chef Infrastructure.

Make sure you've the berkshelf gem installed as described in the Managing cookbook dependencies with Berkshelf section in Chapter 1, Chef Infrastructure.

Create your Berksfile in your Chef repository including my_cookbook:

mma@laptop:~/chef-repo $ subl Berksfile
cookbook 'my_cookbook', path: './cookbooks/my_cookbook'

How to do it...

Let's change some attributes and install SNMP on our node:

  1. Add the dependency on the snmp cookbook to your cookbook's metadata.rb file:

    mma@laptop:~/chef-repo $ subl cookbooks/my_cookbook/metadata.rb
    depends "snmp"
  2. Install the dependent...