SlideShare a Scribd company logo
1 of 30
Download to read offline
Introduction to "Chef" framework

      Silesian Ruby Users Group
          Wojciech Wn¦trzak



         December 3, 2010
What Is Chef?




Open Source (Apache License v. 2.0)
Framework
Ruby
Infrastructure conguration management tool
Chef Is Young

Released on January 15th, 2009
Why To Use Chef?




Only one administration guy in company?
Forces order in system
Existing solutions for your problems
Best practices
How To Use Chef?




chef-client   +   chef-server

chef-client   + Opscode Platform
chef-solo
Chef Server




Ruby gem (chef-server)
Stores cookbooks
Stores information about nodes
Accessbile by REST API
Chef Server Elements




CouchDB  stores node informations
SOLR  data indexing
RabbitMQ  helps in indexing
Merb  API and web user interface
Chef Server Elements




CouchDB  stores node informations
SOLR  data indexing
RabbitMQ  helps in indexing
Merb  API and web user interface


             That is lot of stu !
Opscode Platform




Free plan (upto 5 nodes)
Conguration step by step
Organizations and users managment
Chef Client




Ruby gem (chef)
Runs on machine that we want to congure
Communicates with chef server
Authenticates using RSA keys
Server  Clients
Chef Solo




Part of   chef   gem
Standalone run (without connecting to server)
Uses cookbooks from local tarballs
Simple Workow




Write cookbook with recipe
Upload it to chef server
Dene run list by:
               editing node on chef server
               passing JSON le to chef-client
Run chef-client on desired machine
Cookbooks




Cookbooks for Chef are like RubyGems for
                                    1
                            Ruby




1
    I couldn't nd author
Cookbook Skeleton
Example Attributes File




set[:postgresql][:version] = 8.4
set[:postgresql][:dir] =
  /etc/postgresql/#{node[:postgresql][:version]}/main
PostgreSQL Server Recipe


include_recipe postgresql::client

package postgresql-#{node[:postgresql][:version]} do
  action :install
end

template #{node[:postgresql][:dir]}/postgresql.conf do
  source postgresql.conf.erb
  owner postgres
  group postgres
  mode 0600
end

service postgresql-#{node[:postgresql][:version]} do
  action :start
end
Recipe Features


include_recipe postgresql::client

package postgresql-#{node[:postgresql][:version]}

service postgresql do
  service_name postgresql-#{node[:postgresql][:version]}
  supports :restart = true, :status = true
  action :nothing
end

template #{node[:postgresql][:dir]}/postgresql.conf do
  source postgresql.conf.erb
  owner postgres
  group postgres
  mode 0600
  notifies :restart, service[postgresql]
end
Package Providers




Apt
Yum
MacPorts
Package Providers




Apt
Yum
MacPorts

           Many more
Supported Systems




Debian
Gentoo
FreeBSD
MacOSX
Solaris
Supported Systems




Debian
Gentoo
FreeBSD
MacOSX
Solaris
Windows
Supported Systems




Debian
Gentoo
FreeBSD
MacOSX
Solaris
Windows

          And more
Resources2


     package
     template
     le
     user
     execute
     script (bash, ruby, perl, python, csh)
     http_request
     deploy




2
    http://wiki.opscode.com/display/chef/Resources
Resources2


     package
     template
     le
     user
     execute
     script (bash, ruby, perl, python, csh)
     http_request
     deploy

                            Many more



2
    http://wiki.opscode.com/display/chef/Resources
Additional Tools - Ohai




Released as a gem    ohai

Collects system conguration/information
Returns   JSON
Additional Tools - Knife




Part of   chef   gem
Console tool for chef server managment
Tips




      If using   RVM,   use   rvmsudo   for   chef-client

      Take a look at chef      bootstrap3
      Remember that Ruby (Chef) uses             sh,   not   bash




  3
    http://wiki.opscode.com/display/chef/Bootstrap+Chef+RubyGems+
Installation
Useful Links




http://www.opscode.com/chef/
http://help.opscode.com/faqs/start/how-to-get-started
http://cookbooks.opscode.com/
https://github.com/opscode/cookbooks
Thank You




Questions?

More Related Content

What's hot

chef loves windows
chef loves windowschef loves windows
chef loves windows
Mat Schaffer
 

What's hot (20)

Docker Docker Docker Chef
Docker Docker Docker ChefDocker Docker Docker Chef
Docker Docker Docker Chef
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
 
Cooking chef
Cooking chefCooking chef
Cooking chef
 
Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
 
Sim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOpsSim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOps
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Chef in a nutshell
Chef in a nutshellChef in a nutshell
Chef in a nutshell
 
Automation and Ansible
Automation and AnsibleAutomation and Ansible
Automation and Ansible
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
 
Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as Code
 
chef loves windows
chef loves windowschef loves windows
chef loves windows
 
Linecook - A Chef Alternative
Linecook - A Chef AlternativeLinecook - A Chef Alternative
Linecook - A Chef Alternative
 
How to Write Chef Cookbook
How to Write Chef CookbookHow to Write Chef Cookbook
How to Write Chef Cookbook
 
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
 
What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)
 

Similar to Introduction to chef framework

Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
Gengo
 
Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for Openstack
Mohit Sethi
 

Similar to Introduction to chef framework (20)

Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and You
 
Cook like a Chef
Cook like a ChefCook like a Chef
Cook like a Chef
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
 
DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
What is Chef and how we use it at tripsta
What is Chef and how we use it at tripstaWhat is Chef and how we use it at tripsta
What is Chef and how we use it at tripsta
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef Opswork
 
Consistent Development Environment using Vagrant and Chef
Consistent Development Environment using Vagrant and ChefConsistent Development Environment using Vagrant and Chef
Consistent Development Environment using Vagrant and Chef
 
IT Automation with Chef
IT Automation with ChefIT Automation with Chef
IT Automation with Chef
 
Chef
ChefChef
Chef
 
Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Treat your servers like your Ruby App: Infrastructure as Code
Treat your servers like your Ruby App: Infrastructure as CodeTreat your servers like your Ruby App: Infrastructure as Code
Treat your servers like your Ruby App: Infrastructure as Code
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
 
Chef for openstack
Chef for openstackChef for openstack
Chef for openstack
 
Chef
ChefChef
Chef
 
Learning chef
Learning chefLearning chef
Learning chef
 
Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for Openstack
 
Chef, Vagrant and Friends
Chef, Vagrant and FriendsChef, Vagrant and Friends
Chef, Vagrant and Friends
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Introduction to chef framework