From the course: Learning Chef

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Ruby and resources

Ruby and resources

From the course: Learning Chef

Start my 1-month free trial

Ruby and resources

- [Instructor] Now that you understand what a Chef resource is, we can think about how to use Ruby appropriately. A resource again is a statement of configuration policy. And actually most built in Chef resources can accomplish the configuration tasks that you need. Chef resources are designed to describe configurations on many different platforms and be versatile enough to fit your needs. In other words use Chef resources whenever possible. Remember our definition of a Chef resource. When we use them we describe the type of resource that we're configuring. It's name and then any properties we'd like to take action with. This is the basic structure of any Chef resource that you'll work with. What I want you to understand about this is that Chef resources are authored with Ruby syntax and have a .rb Ruby file extension. Recipes contain Chef resources. However, Chef resources are not pure Ruby code and cannot be run inside of a Ruby interpreter like Ruby IRB. It's important to…

Contents