chef cookbook dependencies
The features of defining cookbook dependencies help in managing cookbooks. This feature is used when we want to use the functionality of one cookbook in other cookbooks.For example, if we want to compile C code, you must make sure that all the dependencies necessary for the compilation are installed. To do this, there may be a separate cookbook that can perform such a function.
When using chef-server, we need to be aware of these dependencies in cookbooks that should be decelerated in the cookbooks data file. This file is located at the top of the cookbook directory structure. It guides the Chef server who helps deploy cookbooks to the correct node.
Features of metadata.rb file in chef cookbook dependencies
*Located at the top in the cookbook directory structure.
*Compiled when the cookbook is uploaded to Chef server using knife command.
*Compiled with knife cookbook metadata subcommand.
*It Automatically creates when the knife cookbook command is run.
Following is the default content of a metadata file.
maintainer 'The Authors'
maintainer_email '[email protected]'
license 'All Rights Reserved
description 'Installs/Configures httpd_deploy'
long_description 'Installs/Configures httpd_deploy'
chef_version '>= 12.1' if respond_to?(:chef_version)
*Attribute: This defines a list of attributes that are required to configure a cookbook
*chef version: The range of chef-client version is supported by a cookbook
*Depends: This field requires a cookbook with a specified name and version that exists on the chef server.
*Description: A short description of the cookbook and functionality
*Licence: It defines the type of license under which the cookbook is distributed