Chef resources

Chef uses Ruby to define configuration items. A configuration item is defined as a resource. A cookbook contains a set of resources for one feature.

Chef manages types of resources. Each resource has a type, a name, one or more properties, and one action. Every property has a value. The value specifies the state desired for the resource. You can specify the state of a device by setting values for properties regardless of how the device enters the state. The following resource example shows how to configure a device to create VLAN 2 and configure the description for VLAN 2.

netdev_vlan 'vlan2' do
 vlan_id 2
 description 'chef-vlan2'
 action :create
end

The following are the resource type, resource name, properties, and actions:

Chef supports only the create and delete actions.

For more information about resource types supported by Chef, see "Chef resources."