Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

Understanding the chef cookbook’s Berkshelf file

Spread the Knowledge

Configuration Management using chef is being implemented with the help of desire files, which is often called a “cookbooks” in chef. Usuallay separate cookbooks is written in practice for each module so its easy to maintain. Also, there are good numbers of cookbooks which is being used from community portal which is from supermarket.chef.io.

In order to meet the desire state in servers, once the multile cookbooks is used, Very often these cookbooks become large and highly interdependent, it becomes necessary to manage these cookbooks itself.

Berkshelf is the tool which makes ‘the management’ & dependency management between cookbooks easy. Berkshelf is a dependency manager for Chef cookbooks. With it, you can easily depend on community cookbooks and have them safely included in your workflow. Using Berkshelf, you need to package, bundle dependent cookbooks rather using it will download from “source” which is defined in Berksfile.

Berkshelf is included in the Chef Development Kit.

Quick Start
Running “chef generate cookbook” will, by default, create a Berksfile in the root of the cookbook, alongside the cookbook’s metadata.rb. As usual, add your cookbook’s dependencies to the metadata:

[code]name ‘my_first_cookbook’
version ‘0.1.0’
depends ‘apt’, ‘~> 5.0′[/code]

The default Berksfile will contain the following:

[code]source ‘https://supermarket.chef.io’
metadata[/code]

Now, when you run “berks install“, the apt cookbook will be downloaded from Supermarket into the cache…

[code]$ berks install
Resolving cookbook dependencies…
Fetching ‘my_first_cookbook’ from source at .
Fetching cookbook index from https://supermarket.chef.io…
Installing apt (5.0.0)
Using my_first_cookbook (0.1.0) from source at .
Installing compat_resource (12.16.2)[/code]

Example of Berksfile

[code]source “https://supermarket.chef.io”

metadata
cookbook ‘zabbix-agent’, path: ‘cookbooks/zabbix-agent’
cookbook ‘hostnames’, path: ‘cookbooks/hostnames’
cookbook ‘chef-client’, path: ‘cookbooks/chef-client’
cookbook ‘rethinkdb’, path: ‘cookbooks/rethinkdb’
cookbook ‘zookeeper’, path: ‘cookbooks/zookeeper’
cookbook ‘logstash’, path: ‘cookbooks/logstash’
cookbook ‘kafka’, path: ‘cookbooks/kafka’
cookbook ‘elasticsearch’, path: ‘cookbooks/elasticsearch’
cookbook ‘testbook’, path: ‘cookbooks/testbook’
cookbook ‘base-ubuntu’, path: ‘cookbooks/base-ubuntu'[/code]

Important Notes
For new users, we strongly recommend using Policyfiles rather than Berkshelf. Policyfiles provide more predictability, since dependencies are only resolved once, and a much improved way of promoting cookbooks from dev to testing, and then to production. Note that Policyfile is not supported as part of a Chef Automate workflow.

Rajesh Kumar
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x