Assignment5.1(Chef)

Chef:

Chef is a tool used for Configuration Management. Chef is an automation tool that provides a way to define infrastructure as code. Infrastructure as code simply means that managing infrastructure by writing code rather than using manual processes. It can also be termed as programmable infrastructure. Chef uses a pure-Ruby, domain-specific language for writing system configuration.

Advantages of Chef:

  1. Accelerating Software Delivery
  2. Increasing Service Resiliency
  3. Improving Risk Management
  4. Accelerating Cloud Adoption
  5. Managing Both Data Center and Cloud Environments
  6. Delivering All Your Infrastructure
  7. Reduction of work time
  8. Application to multiple servers at once
  9. Reduction of operation cost
  10. Redecoration of construction

Installation of chef workstation:

  • wget https://packages.chef.io/files/stable/chef-workstation/22.5.923/el/7/chef-workstation-22.5.923-1.el7.x86_64.rpm
  • ls
  • rpm -ivh chef-workstation-22.5.923-1.el7.x86_64.rpm
  • which chef
  • ls /usr/bin/chef*
  • chef version

Example program for recipe:

$ chef-apply filename.rb

In file.rb type:

file ‘/opt/first.txt’

file ‘/opt/first.txt’ do

action :delete

end

file ‘/opt/content.txt’ do

content “This is my first program of chef”

mode 755

owner root

end

httpd

create a index.html

copy index.htmkl

start

package ‘name’ do

package_name “httpd”

end

file ‘index.html’ do

content “<h1> Welcome to DevOpsSchool Chef Class</h1>”

end

bash ‘extract_module’ do

code <<-EOH

cp index.html /var/www/html/

EOH

end

service ‘httpd’ do

service_name “httpd”

action :start

end

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x