At JAX London 2012, I walked a developer audience through what infrastructure as code actually looks like in practice, focusing on Chef and Puppet. These are not shell script replacements – they abstract away the specifics of package managers, init systems, and operating systems so you can describe what you want your infrastructure to be rather than how to get there.
The two tools take fundamentally different approaches. Puppet has a restrictive DSL that keeps sysadmins from going wild – it is closer to a configuration file than a programming language. Chef gives you the full power of Ruby intermixed with its own DSL, which developers love but which can lead to cookbooks that are harder to read than simple declarations. I have seen admins gravitate toward Puppet because the strict DSL feels safe, while developers tend to pick Chef because the Ruby syntax is familiar.
The language constructs reveal the differences clearly. Puppet has parameterized classes that are singletons – you can only install one Apache. If you want multiple instances, you need a define construct. Chef passes parameters through attributes and has its own library system. Variables, inheritance, loops – each tool handles them differently. Puppet deliberately has no loop construct in its DSL, which annoys developers but keeps the code readable. Chef lets you use any Ruby construct, which opens Pandora’s box.
The real point was that infrastructure code deserves the same practices we apply to application code: version control, code review, testing, and continuous integration. But the testing story is different. You cannot unit test a server the way you unit test a function. You need integration tests with real VMs, which is where Vagrant comes in. The code may look different from what developers are used to, but the discipline of treating it as code – with all the rigor that implies – is what makes infrastructure as code work.
Watch on YouTube – available on the jedi4ever channel
This summary was generated using AI based on the auto-generated transcript.