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.

#cat metadata.rb

name 'httpd_deploy'

maintainer 'The Authors'

maintainer_email '[email protected]'

license 'All Rights Reserved

description 'Installs/Configures httpd_deploy'

long_description 'Installs/Configures httpd_deploy'

version '0.1.0'

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

*Long Description: A long description ideally contains full information about how the cookbook performs and how we are going to use it



Relevant Blogs: 

chef adding nodes 

chef roles 

Google Cloud Platform 

Difference between forks and serial in ansible

Recent Comments

No comments

Leave a Comment