How to install Chef Client on Linux | How to create Chef Cookbook Recipe
Hello Guy's this video will helps you how we can use chef cookbook and recipe. So watch this video till end you will learn. If any issue let me know in comments.
Below I have pasted all command. I hope it will helps you.
Commands:
yum update -y
wget https://packages.chef.io/files/stable...
ls
yum install chef-workstation-20.7.96-1.el7.x86_64.rpm -y
which chef
chef -v
mkdir cookbooks
ls
cd cookbooks/
chef generate cookbook first-cookbook
tree
yum install tree -y
tree
cd first-cookbook/
ls
chef generate recipe first-recipe
vi first-cookbook/recipes/first-recipe.rb
chef exec ruby -c first-cookbook/recipes/first-recipe.rb
chef-client -zr "recipe[first-cookbook::first-recipe]"
Recipe:
file '/myfirstfile' do
content 'This is my first file created by cookbook'
action :create
end