Chef configuration management tool is a extensible and customizable solution that Chef workstation allows organizations to manage their enterprise IT infrastructure (laptop, desktop, server) through automation, regardless of operating system.
Table of content
- Chef Workstation Download
- Chef server installation
- Chef server architecture
- How do you create a recipe in Chef?
- Chef recipe modification
- How do you create package recipe in Chef?
Step 1: Chef Server Download
Follow the desire link to download chef server RPM packages.
Copy that chef server link and use wget command to download chef workstation on Linux system.
# wget https://example.rpm
Step 2 : Chef server installation
# yum install chef-workstation-22.10.1013-1.el7.x86_64.rpm
If, you want to check chef file are install or not use those command.
# which chef
# chef -v
# mkdir cookbooks
# cd cookbooks
# pwd
Step 3: Chef server architecture
Chef generate command help of create a category cookbook for example web-cookbook, create-cookbook that can hold multiple recipes which you can segregate accordingly your requirement.
# chef generate cookbook create_cookbook
Use those command for showing status. If “tree” command is not working then, you should install ” yum install tree” command
# ls
# tree
Step 4: How do you create a recipe in Chef?
# chef generate recipe file_creat_recipe
use “tree” command for showing created recipe and “cd ..” command to one step back of directory path.
# tree
# cd ..
Use this command to entry on you recipe
Note: you must be add .rd of you recipe extension
# vi creat_cookbook/recipes/file_creat_recipe.rb
———————————–
file ‘/myfile’ do
content ‘welcome to my new chef blog’
action :create
end
Use “chef exec” troubleshoot command to check file systax
# chef exec ruby -c creat_cookbook/recipes/file_creat_recipe.rb
Use this command for client call for apply this recipe of the system
# chef-client -zr “recipe[creat_cookbook::file_creat_recipe]”
Step 5: Chef recipe modification
# vi creat_cookbook/recipes/file_creat_recipe.rb
# chef exec ruby -c creat_cookbook/recipes/file_creat_recipe.rb
# chef-client -zr “recipe[creat_cookbook::file_creat_recipe]”
——————————————
file ‘/myfile’ do
content ‘welcome to my new chef blog’
action :create
owner ‘ec2-user’
group ‘ec2-user’
end
Step 6: How do you create package recipe in Chef?
Follow, the instauration to install httpd package
# vi web_cookbook/recipes/apache_recipe.rb
# chef exec ruby -c web_cookbook/recipes/apache_recipe.rb
# chef-client -zr “recipe[web_cookbook::apache_recipe]”
——————————————
package ‘httpd’ do
action :install
end
file ‘/var/www/html/index.html’ do
content ‘welcome to my chef workstation blog’
action :create
end
service ‘httpd’ do
action [:enable, :start]
end
Install Git in Linux | Git log, Push, Pull
- Install Git
- Set up Git
- Create working file
- Check git log
- Create GitHub Account
- Generate and copy 2FA password
- Push and Pull working data to Github account for use world wide.
How to git branch Create, Delete, Rename
- create a code and commit
- Create new branch
- Code add and commit in new branch
- Rename branch
- Delete branch
Git Merge branch and Conflict – Step By Step
- Create branch
- Git Merge branch create
- Conflict branch
Great work! This is the type of information that should be shared around the internet. Shame on Google for not positioning this post higher! Come on over and visit my website . Thanks =)