For creating simple recipes you only need to use resources such as
service. But as your recipes become more elaborate, you'll discover the need to do more advanced things such as conditionally executing parts of your recipe, looping, or even complex calculations.
Instead of declaring the
gem_package resource 10 times simply using different name attributes, it is so much easier to loop through an array of gem names creating the
gem_package resources on the fly.
This is the power of mixing plain Ruby with Chef Domain Specific Language (DSL). We'll see a few tricks in the following sections.
Start a Chef Shell on any of your nodes in client mode to be able to access your Chef Server: ...