Are you finding difficulty in remembering all the commands that you need in order to work with Chef? Guys don’t worry if you are a beginner and have no idea about how Chef works, this Chef cheat sheet will give you a quick reference of the basics that you must know to get started.
While at Intellipaat, we support our learners with a handy reference, that’s the reason we have created this Cheat sheet. This cheat sheet is designed for the one who has already started learning about Chef but needs a handy reference sheet.
It is open source and released by Opscode. It is a config management technology developed primarily to automate infrastructure provisioning.
Prepare yourself for the Top DevOps Interview Questions And Answers!
Now Discussing its features:
Before proceeding towards its components & basic commands, let’s understands the basic terminologies of Chef.
Become Master of DevOps by going through this online DevOps training in London.
Now let’s check the important component used in chef.
Chef basically works on a 3-tier client server model. Command line utilities are uploaded to the server and all nodes are registered with the server.
Chef has three main players in its architecture, which are Chef Workstation, Chef Server, Chef Nodes.
Learn more about DevOps in this DevOps training in Sydney to get ahead in your career!
Runlist provides the recipes and the roles required for the node.Different from other config management tools that makes you define a relationship between each resource. Hence ordered list is easier to understand and use.
$ knife node show s1.mydomain.com
Node Name: s1.mydomain.com
Run List: role[common]
Recipes: chef-client, users::sysadmins, sudo
Platform: ubuntu 10.1
$ knife node run_list add s1.mydomain.com “role[profit]”
If you have any doubts or Queries related to DevOps, get it clarifies from DevOps Experts on DevOps Community.
A working unit of chef which is used for configuration and policy distribution.
Cookbooks will define a scenario and will contain everything which is required to provision that scenario.
It is converted to JSON when installed in the server and returns the name, version and other properties. Most of the contents in it are for human use and is displayed on the interface.
Main parts are version and depends statements.
It contains the documentation of the cookbook on how to use it and is useful when it is being shared with others. Markdown is supported while RDoc is the default.
Since it is open source, it allows the sharing of cookbooks in the community.
It supports downloading and sharing of cookbook on http://community.opscode.com/ to store, rate, and search shared cookbooks.
Test the cookbook to make sure it doesn’t break down during production.
example@localmach:~/chef-repo $ knife cookbook site install <cookbook name>
example@localmach:~/chef-repo $ knife cookbook test VTest
Running syntax check on ntp
Validating ruby files
example@localmach:~/chef-repo $ subl cookbooks/VTest/recipes/default.rb
node[‘ntp’][‘statsdir’] ].each do |ntpdir|
directory ntpdir do
package “cucumber” do
Interested in getting an industry-recognized certification in DevOps? Enroll in Intellipaat’s DevOps Course in Bangalore now!
Now, you know the most important skill set of a DevOps Engineer. But, do you know, DevOps Engineers are among the highest paid professionals in the technology domain? so join DevOps training in Hyderabad!
|Get version||Knife –version|
|Create cookbook||Knife cookbook create <cookbook name>|
|Download cookbook||Knife cookbook download <cookbook_name > <version>|
|List cookbooks on the server||Knife cookbook list|
|Use chef supermarket||Knife cookbook site list|
|Getting list of all client nodes||Knife client list|
|Add recipe to runlist for node||Knife node run_list add module2 “recipe[apache]|
|Remove item from the runlist||Knife node run_list remove module2 “recipe[apache]|
Get in touch with Intellipaat for a comprehensive DevOps Training and be a certified DevOps Engineer!
We have covered all the basics of Chef in this cheat sheet. If you want to start learning DevOps in depth then check out the DevOps Certification by Intellipaat.
Not only will you get to learn and implement Chef with a step by step guidance and support from us, but you will also get to learn other important topics in DevOps such as Docker, Git/GitHub, Ansible, Jenkins, Puppet, Selenium, Nagios and many more. You will also get 24*7 technical support to help you with any and all your queries, from the experts in the respective technologies here at intellipaat throughout the certification period. So, why wait? Check out the training program and enroll today!Previous Next
Download Interview Questions asked by top MNCs in 2019?