Book Image

Mastering Chef

By : Mayank Joshi
Book Image

Mastering Chef

By: Mayank Joshi

Overview of this book

Table of Contents (20 chapters)
Mastering Chef
About the Author
About the Reviewers
Knife and Its Associated Plugins
Data Bags and Templates

Extending Chef to bootstrap distributed systems

Most configuration management systems such as Chef, Puppet, CFEngine, Ansible, and so on, operate at a node level, and any configuration change that is required to be made is applied only upon the convergence runs that happen at the scheduled intervals and aren't event-based. For example, say you've a setup comprising of a load balancer (say HAProxy) and web servers. Now, you are running a website and you want to ensure that as soon as the traffic spikes up, you should be able to provision a new web server.

You've written the HAProxy cookbook so that it searches for nodes of type webserver, populates its config, and reloads the HAProxy process. You've also written the Chef code to bring up the web server; however, even once the server is up and running, your load balancer has no knowledge of this and either you have to manually trigger the chef-client run, or if you are running a chef-client as a daemon or cron job, you have to wait for the...