Chef Cookbook Design Patterns
summary
Shows how Opscode-style Chef cookbooks are structured: uses attributes and file_cache_path to make remote_file downloads and source builds configurable instead of hardcoded; demonstrates switching between platform package vs source installs and declaring metadata deps like build-essential. Explains using server-side search to discover Nagios clients and data bags for dynamic config, describes writing libraries and lightweight providers in Ruby, building a GNU Parallel cookbook in about 30 minutes, and testing by uploading cookbooks and running chef-client or Vagrant-built nodes.
AI-written summary · about
chapters (20)
- 0:00Start
- 8:01Do that in a recipe
- 8:25remote_file problems
- 9:29tmp isn't a great location
- 10:06remote_file using attributes
- 11:02bash script using attributes
- 11:24Attribute conditional on platform in attributes file
- 18:02Benefits of Chef Server
- 18:51Hardcoding data: Anti-pattern
- 19:38File specificity
- 20:16Static vs Dynamic Resources
- 21:28Recipe Helpers
- 22:02LWRP Helpers
- 22:46Heavyweight Resources & Providers
- 23:44Resource DSL
- 23:59Validation Parameters
- 24:29Lightweight Providers
- 24:49Provider action code
- 25:23Use it in a recipe!
- 27:04Opscode's cookbook examples
related talks
42m5 Things You Didn't Know About Chef
41mChef Cookbook Testing Like a Pro
25mCooking with Chef - Your servers will thank you
33mDeveloping for Multi-Component Environments While Keeping Your Sanity
38mAn Approach to Air-Gapped Deployment
42mCI Techniques for Delivering the Chef-Repo: Three Case Studies
06mTen Quick Tips to Improve Your Chef Workflow
01h 21mTest Driving your Rails Infrastructure with Chef
