$ chef generate cookbook my_first_cookbook Let’s use chef to generate our first cookbook, called my_first_cookbook. With our development environment set up it’s time to create our first cookbook. Again, if you want to follow along, go get them now.
We’ll also be using VirtualBox as the virtual machine host environment and Vagrant as its driver. Chef Server is a whole other topic and an article in itself, so it won’t be mentioned in the remainder of this article. You might notice that the real Chef Server was not mentioned. Finally Chef Zero is an in-memory Chef Server, whose main use case is testing. Its name should be prefixed with “Swiss Army”… if you’re curious, type knife -h at the terminal. Knife is a command-line tool that interacts with Chef. Ohai is a tool whose main purpose is to gather the attributes (e.g.: memory, cpu, platform information) of a node and feed them to Chef Client. Chef Client is the tool that runs inside a node (i.e., a machine or server) and given a run_list (a set of cookbooks) configures it. It also includes a host of other Chef tools: Chef Client Ohai Knife and Chef Zero. Test Kitchen, an integration testing tool.Berkshelf, a cookbook dependency manager.chef, a command-line tool, still on its early stages, that aims to streamline the Chef development workflow.
We’ll start from there so, if you want to follow along, download Chef DK now. I assume you’re working in a Linux environment, but we’ll also cover Windows.Įarlier this year, Chef released the Chef Development Kit (Chef DK), which greatly simplifies your development environment setup. If you’re new to Chef, I’ll introduce you to some of its concepts as they appear in the article. On the other hand, all that power brings complexity, which might be warranted or not depending on your use cases.Ĭhef has a somewhat steep learning curve, with lots of concepts and tools that have to be learned. An embedded DSL means you get all the power of a real programming language: powerful abstractions that let you do (virtually) whatever you need a standard library thousands of open source packages a strong body of knowledge and conventions a large community. Get a demo.Ĭhef uses an internal DSL (domain specific language) in Ruby. If you already know the basics of Chef and are in a hurry, you can just jump to the "Cookbook Development Process" section.Įxperience analytics-ready data in minutes with cloud-native data integration.
We’ll use Chef, a well-known IT automation tool, to illustrate the state of the art. How far can we go with the “Infrastructure as Code” metaphor? Pretty far, actually.
Development practices have also evolved rapidly and nowadays that means continuous integration (even delivery!), automated tests, code coverage and more. But treating Infrastructure as Code is a tall order. It might even be called revolutionary if you can remember the days when virtual machines were a novel thing and physical hardware was the norm. “Infrastructure as Code” is a tenet of the DevOps community.