SlideShare a Scribd company logo
1 of 22
Michael Richardson
Email: michael@energizedwork.com
2© 2011 Energized Work - www.energizedwork.com
Agenda
Chef Architecture
• Chef Server
• Chef Client
• Web UI
• Chef Solo
• Knife
Chef Basics
• Cookbooks
• Nodes
• Roles
• Attributes
Examples
Useful links
3© 2011 Energized Work - www.energizedwork.com
Chef Architecture
4© 2011 Energized Work - www.energizedwork.com
Chef Server – Architecture
5© 2011 Energized Work - www.energizedwork.com
Server components:
• Chef Server
• Chef Server Web UI
• CouchDB
• RabbitMQ
• Chef Solr Indexer
• Chef Solr
Client components:
• Chef Client
• Chef Solo
• Knife
• Shef
Chef Server
• Merb Web application
• API service
• Data stored with CouchDB
• Distributes cookbooks to Chef Clients
6© 2011 Energized Work - www.energizedwork.com
Chef Server Web UI
• Merb Web application
• Talks to Chef Server API service
• Data stored with CouchDB
7© 2011 Energized Work - www.energizedwork.com
Knife
• Command line interface to Chef
• Alternative to using the Chef-Server Web UI
• Allows you to create, list, edit and delete objects in Chef-Server
8© 2011 Energized Work - www.energizedwork.com
Chef Client
• Clients do all the work
• Communicates with Chef Server via REST
• Downloads, Compiles and Executes cookbooks
• Can run periodically as a daemon or as a single run
• Ohai (part of chef-client). Provides node information to Chef
9© 2011 Energized Work - www.energizedwork.com
Chef Basics
10© 2011 Energized Work - www.energizedwork.com
Nodes
• A node is a host that runs chef client
• Primary feature of a node are it’s attributes and it’s run list
• Nodes are made up of two prime components
• Recipes
• Roles
11© 2011 Energized Work - www.energizedwork.com
Nodes – Run List
• Run list is a list of the recipes that a node will run
• Order is important
• Can include roles which may have recipes assigned to them
12© 2011 Energized Work - www.energizedwork.com
Attributes
• Nodes and roles have associated attributes (key-value pairs)
• Node and role attributes are used as inputs for resource attributes
• Attributes maybe set on a node from the following objects
• Cookbooks
• Roles
• Nodes
13© 2011 Energized Work - www.energizedwork.com
Roles
• Compose functionality sets for nodes through recipes and attributes
• 2 workflows for managing roles
• Write Ruby or JSON files
• Use Knife or Web UI
14© 2011 Energized Work - www.energizedwork.com
Cookbooks
• Collection of files used to configure a system
/cookbook/
/attributes/
/definitions/
/files/
/libraries/
/metadata.rb
/README.rdoc
/recipes/
/templates/
• Each cookbook typically configures a single package of service
• Cookbooks are commonly shared in the Chef community
15© 2011 Energized Work - www.energizedwork.com
Cookbooks – Recipes
• Encapsulates resources (fundamental units in Chef)
• Resource:
16© 2011 Energized Work - www.energizedwork.com
Cookbooks – Recipes
• Basic examples of resources
17© 2011 Energized Work - www.energizedwork.com
package "tar" do
version "1.16.1-1"
action :install
end
remote_file "/tmp/testfile" do
source "http://build.ew/warfiles/testfile"
mode "0644"
checksum "08da002l"
end
service ”httpd" do
supports :status => true, :restart => true, :reload => true
action [ :enable, :start ]
end
cookbook_file "/tmp/testfile" do
source "testfile"
mode "0644"
end
directory "/tmp/something" do
owner "root"
group "root"
mode "0755"
action :create
end
template "/tmp/config.conf" do
source "config.conf.erb"
end
link "/tmp/passwd" do
to "/etc/passwd"
end
Cookbooks – Files and templates
• Files allow you to distribute files to your servers as part of cookbooks
• Templates are files that have been marked up to include variables
• To allow cookbooks to operate on multiple platforms, files and
templates can be found in a number of locations within a cookbook
18© 2011 Energized Work - www.energizedwork.com
Eg in order of priority.
cookbook/templates/webapp01.ew/sudoers.erb
cookbook/templates/ubuntu-8.04/sudoers.erb
cookbook/templates/ubuntu/sudoers.erb
cookbook/templates/default/sudoers.erb
Cookbooks – Template example
• Simple template resource
• Simple ERB template file – templates/default/foo.erb
• Rendered file on client
19© 2011 Energized Work - www.energizedwork.com
node[:fqdn] = ”webapp01.ew"
template "/tmp/foo" do
source "foo.erb"
variables({
:java_app => ”SomethingCool.war"
})
end
The node <%= node[:fqdn] %> is running the app <%= @java_app %>
# cat /tmp/foo
The node webapp01.ew is running the app SomethingCool.war
#
Useful links
• http://www.opscode.com/
• http://wiki.opscode.com/display/chef/Home
• http://wiki.opscode.com/display/chef/Resources
• http://cookbooks.opscode.com/
• https://github.com/37signals/37s_cookbooks
• https://github.com/opscode/cookbooks
20© 2011 Energized Work - www.energizedwork.com
Chef Examples
21© 2011 Energized Work - www.energizedwork.com
22© 2011 Energized Work - www.energizedwork.com
Thank you
Email: michael@energizedwork.com

More Related Content

What's hot

Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with ChefJohn Ewart
 
Infrastructure Automation with Chef
Infrastructure Automation with Chef Infrastructure Automation with Chef
Infrastructure Automation with Chef REAN Cloud
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with ChefJoe Kepley
 
Chef - Administration for programmers
Chef - Administration for programmersChef - Administration for programmers
Chef - Administration for programmersmrsabo
 
Chef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesMamun Rashid, CCDH
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Chef
 
Apache Ambari - What's New in 1.2.3
Apache Ambari - What's New in 1.2.3Apache Ambari - What's New in 1.2.3
Apache Ambari - What's New in 1.2.3Hortonworks
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshopjtimberman
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Software, Inc.
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Pravin Mishra
 
Growing Pains with Chef – a Tale of DevOps in a Large Organization
Growing Pains with Chef – a Tale of DevOps in a Large OrganizationGrowing Pains with Chef – a Tale of DevOps in a Large Organization
Growing Pains with Chef – a Tale of DevOps in a Large OrganizationChef Software, Inc.
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Software, Inc.
 
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...Chef
 
Rails Engine Patterns
Rails Engine PatternsRails Engine Patterns
Rails Engine PatternsAndy Maleh
 
Sitecore sxa best practices and secrets 29th june 2021
Sitecore sxa best practices and secrets   29th june 2021Sitecore sxa best practices and secrets   29th june 2021
Sitecore sxa best practices and secrets 29th june 2021Jitendra Soni
 

What's hot (20)

Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
 
Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
 
Chef in a nutshell
Chef in a nutshellChef in a nutshell
Chef in a nutshell
 
Infrastructure Automation with Chef
Infrastructure Automation with Chef Infrastructure Automation with Chef
Infrastructure Automation with Chef
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with Chef
 
Chef - Administration for programmers
Chef - Administration for programmersChef - Administration for programmers
Chef - Administration for programmers
 
Chef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS Newbies
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1
 
Apache Ambari - What's New in 1.2.3
Apache Ambari - What's New in 1.2.3Apache Ambari - What's New in 1.2.3
Apache Ambari - What's New in 1.2.3
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
 
Growing Pains with Chef – a Tale of DevOps in a Large Organization
Growing Pains with Chef – a Tale of DevOps in a Large OrganizationGrowing Pains with Chef – a Tale of DevOps in a Large Organization
Growing Pains with Chef – a Tale of DevOps in a Large Organization
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
Spring Cloud Config
Spring Cloud ConfigSpring Cloud Config
Spring Cloud Config
 
Chef
ChefChef
Chef
 
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
There and Back Again: How We Drank the Chef Kool-Aid, Sobered Up, and Learned...
 
Rails Engine Patterns
Rails Engine PatternsRails Engine Patterns
Rails Engine Patterns
 
Sitecore sxa best practices and secrets 29th june 2021
Sitecore sxa best practices and secrets   29th june 2021Sitecore sxa best practices and secrets   29th june 2021
Sitecore sxa best practices and secrets 29th june 2021
 

Viewers also liked

Docker Service Registration and Discovery
Docker Service Registration and DiscoveryDocker Service Registration and Discovery
Docker Service Registration and Discoverym_richardson
 
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...Chef Software, Inc.
 
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 3Chef
 
bootstrapping containers with confd
bootstrapping containers with confdbootstrapping containers with confd
bootstrapping containers with confdm_richardson
 
Persistence in the cloud with bosh
Persistence in the cloud with boshPersistence in the cloud with bosh
Persistence in the cloud with boshm_richardson
 

Viewers also liked (6)

Docker Service Registration and Discovery
Docker Service Registration and DiscoveryDocker Service Registration and Discovery
Docker Service Registration and Discovery
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking 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...
 
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
 
bootstrapping containers with confd
bootstrapping containers with confdbootstrapping containers with confd
bootstrapping containers with confd
 
Persistence in the cloud with bosh
Persistence in the cloud with boshPersistence in the cloud with bosh
Persistence in the cloud with bosh
 

Similar to Chef - managing yours servers with Code

Chef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetupChef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetupPromet Source
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Software, Inc.
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with ChefJohn Osborne
 
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksICF CIRCUIT
 
Chef Cookbook Design Patterns
Chef Cookbook Design PatternsChef Cookbook Design Patterns
Chef Cookbook Design PatternsEric Krupnik
 
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowTXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowMatt Ray
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the MassesSai Perchard
 
Infrastructure modeling with chef
Infrastructure modeling with chefInfrastructure modeling with chef
Infrastructure modeling with chefCharles Johnson
 
Chef conf-2015-chef-patterns-at-bloomberg-scale
Chef conf-2015-chef-patterns-at-bloomberg-scaleChef conf-2015-chef-patterns-at-bloomberg-scale
Chef conf-2015-chef-patterns-at-bloomberg-scaleBiju Nair
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with ChefBryan McLellan
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!Ben Steinhauser
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetupSuresh Paulraj
 

Similar to Chef - managing yours servers with Code (20)

Chef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetupChef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetup
 
Chef for openstack
Chef for openstackChef for openstack
Chef for openstack
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
 
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
 
Chef Cookbook Design Patterns
Chef Cookbook Design PatternsChef Cookbook Design Patterns
Chef Cookbook Design Patterns
 
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowTXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the Masses
 
Infrastructure modeling with chef
Infrastructure modeling with chefInfrastructure modeling with chef
Infrastructure modeling with chef
 
Chef conf-2015-chef-patterns-at-bloomberg-scale
Chef conf-2015-chef-patterns-at-bloomberg-scaleChef conf-2015-chef-patterns-at-bloomberg-scale
Chef conf-2015-chef-patterns-at-bloomberg-scale
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
 
Configuration management with Chef
Configuration management with ChefConfiguration management with Chef
Configuration management with Chef
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
 
Chef
ChefChef
Chef
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetup
 

More from m_richardson

Puppetcamp Melbourne - puppetdb
Puppetcamp Melbourne - puppetdbPuppetcamp Melbourne - puppetdb
Puppetcamp Melbourne - puppetdbm_richardson
 
Node collaboration - sharing information between your systems
Node collaboration - sharing information between your systemsNode collaboration - sharing information between your systems
Node collaboration - sharing information between your systemsm_richardson
 
Node collaboration - Exported Resources and PuppetDB
Node collaboration - Exported Resources and PuppetDBNode collaboration - Exported Resources and PuppetDB
Node collaboration - Exported Resources and PuppetDBm_richardson
 
Serverspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collideServerspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collidem_richardson
 
System Availability Talk
System Availability TalkSystem Availability Talk
System Availability Talkm_richardson
 
Open Source Monitoring Tools
Open Source Monitoring ToolsOpen Source Monitoring Tools
Open Source Monitoring Toolsm_richardson
 

More from m_richardson (6)

Puppetcamp Melbourne - puppetdb
Puppetcamp Melbourne - puppetdbPuppetcamp Melbourne - puppetdb
Puppetcamp Melbourne - puppetdb
 
Node collaboration - sharing information between your systems
Node collaboration - sharing information between your systemsNode collaboration - sharing information between your systems
Node collaboration - sharing information between your systems
 
Node collaboration - Exported Resources and PuppetDB
Node collaboration - Exported Resources and PuppetDBNode collaboration - Exported Resources and PuppetDB
Node collaboration - Exported Resources and PuppetDB
 
Serverspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collideServerspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collide
 
System Availability Talk
System Availability TalkSystem Availability Talk
System Availability Talk
 
Open Source Monitoring Tools
Open Source Monitoring ToolsOpen Source Monitoring Tools
Open Source Monitoring Tools
 

Recently uploaded

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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 MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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...apidays
 
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 slidevu2urc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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...
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Chef - managing yours servers with Code

  • 1.
  • 2. Michael Richardson Email: michael@energizedwork.com 2© 2011 Energized Work - www.energizedwork.com
  • 3. Agenda Chef Architecture • Chef Server • Chef Client • Web UI • Chef Solo • Knife Chef Basics • Cookbooks • Nodes • Roles • Attributes Examples Useful links 3© 2011 Energized Work - www.energizedwork.com
  • 4. Chef Architecture 4© 2011 Energized Work - www.energizedwork.com
  • 5. Chef Server – Architecture 5© 2011 Energized Work - www.energizedwork.com Server components: • Chef Server • Chef Server Web UI • CouchDB • RabbitMQ • Chef Solr Indexer • Chef Solr Client components: • Chef Client • Chef Solo • Knife • Shef
  • 6. Chef Server • Merb Web application • API service • Data stored with CouchDB • Distributes cookbooks to Chef Clients 6© 2011 Energized Work - www.energizedwork.com
  • 7. Chef Server Web UI • Merb Web application • Talks to Chef Server API service • Data stored with CouchDB 7© 2011 Energized Work - www.energizedwork.com
  • 8. Knife • Command line interface to Chef • Alternative to using the Chef-Server Web UI • Allows you to create, list, edit and delete objects in Chef-Server 8© 2011 Energized Work - www.energizedwork.com
  • 9. Chef Client • Clients do all the work • Communicates with Chef Server via REST • Downloads, Compiles and Executes cookbooks • Can run periodically as a daemon or as a single run • Ohai (part of chef-client). Provides node information to Chef 9© 2011 Energized Work - www.energizedwork.com
  • 10. Chef Basics 10© 2011 Energized Work - www.energizedwork.com
  • 11. Nodes • A node is a host that runs chef client • Primary feature of a node are it’s attributes and it’s run list • Nodes are made up of two prime components • Recipes • Roles 11© 2011 Energized Work - www.energizedwork.com
  • 12. Nodes – Run List • Run list is a list of the recipes that a node will run • Order is important • Can include roles which may have recipes assigned to them 12© 2011 Energized Work - www.energizedwork.com
  • 13. Attributes • Nodes and roles have associated attributes (key-value pairs) • Node and role attributes are used as inputs for resource attributes • Attributes maybe set on a node from the following objects • Cookbooks • Roles • Nodes 13© 2011 Energized Work - www.energizedwork.com
  • 14. Roles • Compose functionality sets for nodes through recipes and attributes • 2 workflows for managing roles • Write Ruby or JSON files • Use Knife or Web UI 14© 2011 Energized Work - www.energizedwork.com
  • 15. Cookbooks • Collection of files used to configure a system /cookbook/ /attributes/ /definitions/ /files/ /libraries/ /metadata.rb /README.rdoc /recipes/ /templates/ • Each cookbook typically configures a single package of service • Cookbooks are commonly shared in the Chef community 15© 2011 Energized Work - www.energizedwork.com
  • 16. Cookbooks – Recipes • Encapsulates resources (fundamental units in Chef) • Resource: 16© 2011 Energized Work - www.energizedwork.com
  • 17. Cookbooks – Recipes • Basic examples of resources 17© 2011 Energized Work - www.energizedwork.com package "tar" do version "1.16.1-1" action :install end remote_file "/tmp/testfile" do source "http://build.ew/warfiles/testfile" mode "0644" checksum "08da002l" end service ”httpd" do supports :status => true, :restart => true, :reload => true action [ :enable, :start ] end cookbook_file "/tmp/testfile" do source "testfile" mode "0644" end directory "/tmp/something" do owner "root" group "root" mode "0755" action :create end template "/tmp/config.conf" do source "config.conf.erb" end link "/tmp/passwd" do to "/etc/passwd" end
  • 18. Cookbooks – Files and templates • Files allow you to distribute files to your servers as part of cookbooks • Templates are files that have been marked up to include variables • To allow cookbooks to operate on multiple platforms, files and templates can be found in a number of locations within a cookbook 18© 2011 Energized Work - www.energizedwork.com Eg in order of priority. cookbook/templates/webapp01.ew/sudoers.erb cookbook/templates/ubuntu-8.04/sudoers.erb cookbook/templates/ubuntu/sudoers.erb cookbook/templates/default/sudoers.erb
  • 19. Cookbooks – Template example • Simple template resource • Simple ERB template file – templates/default/foo.erb • Rendered file on client 19© 2011 Energized Work - www.energizedwork.com node[:fqdn] = ”webapp01.ew" template "/tmp/foo" do source "foo.erb" variables({ :java_app => ”SomethingCool.war" }) end The node <%= node[:fqdn] %> is running the app <%= @java_app %> # cat /tmp/foo The node webapp01.ew is running the app SomethingCool.war #
  • 20. Useful links • http://www.opscode.com/ • http://wiki.opscode.com/display/chef/Home • http://wiki.opscode.com/display/chef/Resources • http://cookbooks.opscode.com/ • https://github.com/37signals/37s_cookbooks • https://github.com/opscode/cookbooks 20© 2011 Energized Work - www.energizedwork.com
  • 21. Chef Examples 21© 2011 Energized Work - www.energizedwork.com
  • 22. 22© 2011 Energized Work - www.energizedwork.com Thank you Email: michael@energizedwork.com

Editor's Notes

  1. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  2. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  3. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  4. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  5. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  6. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  7. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  8. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  9. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  10. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  11. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  12. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  13. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  14. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  15. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  16. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  17. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  18. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  19. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  20. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  21. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING
  22. 28/10/10 © Energized Work Limited 2010 Agile Evangelists - LEANING