Maintaining consistent systems using scheduled convergence
Once initially deployed and configured, it's hardly imaginable to let our systems be manually updated afterwards by logging in to each host and launching the chef-client
command. Systems maintained with Chef have the opportunity to be converged at a predetermined time, either through a chef-client
daemon or a cron job. We'll go through both these options.
Getting ready
To step through this recipe, you will need:
A working Chef DK installation on the workstation
A working Vagrant installation on the workstation
The Chef code (optionally) from either Chapter 6, Fundamentals of Managing Servers with Chef and Puppet, Chapter 7, Testing and Writing Better Infrastructure Code with Chef and Puppet, or any custom Chef code
How to do it…
We recommend that you create a cookbook, different from other cookbooks, dedicated to configuring the underlying host. Let's call this cookbook common
:
$ cd chef-repo/cookbooks $ chef generate cookbook common $...