SlideShare a Scribd company logo
Configuring Nagios with Chef
              Bryan McLellan
              Technical Program Manager, Open Source
              btm@opscode.com / @btmspox




Tuesday, September 25, 12
Overview




                 •      Who am I?
                 •      Why automation
                 •      Introduction to Chef
                 •      Nagios Demo
                 •      Questions



Tuesday, September 25, 12
Who am I?



        •      Chef
               Early developer, user, pundit

        •      10+ years in Systems Administration
               Computer repair, ISPs, Corporate IT,
               Web operations

        •      Event Logistics Volunteer
               Traffic Control, Parking,
               Communications, Networking,
               Emergency Management

        •      Hacker-Operator
               Trucks, Bikes, Radios, Tractors

Tuesday, September 25, 12
How did we get here?



                     Bare Metal Deployment




Tuesday, September 25, 12
How did we get here?



                     Bare Metal Deployment
                       •    Purchasing




Tuesday, September 25, 12
How did we get here?



                     Bare Metal Deployment
                       •    Purchasing
                       •    Vendor build




Tuesday, September 25, 12
How did we get here?



                     Bare Metal Deployment
                       •    Purchasing
                       •    Vendor build
                       •    Delivery




Tuesday, September 25, 12
How did we get here?



                     Bare Metal Deployment
                       •    Purchasing
                       •    Vendor build
                       •    Delivery
                       •    Installation




Tuesday, September 25, 12
How did we get here?



                     Bare Metal Deployment
                       •    Purchasing
                       •    Vendor build
                       •    Delivery
                       •    Installation
                       •    OS deployment




Tuesday, September 25, 12
How did we get here?



                     Bare Metal Deployment
                       •    Purchasing
                       •    Vendor build
                       •    Delivery
                       •    Installation
                       •    OS deployment
                       •    Application deployment




Tuesday, September 25, 12
How did we get here?



                     Bare Metal Deployment
                       •    Purchasing
                       •    Vendor build
                       •    Delivery                 Weeks?
                       •    Installation
                       •    OS deployment
                       •    Application deployment




Tuesday, September 25, 12
How did we get here?



                     Cloud Deployment
                       •    Purchasing
                       •    Vendor build
                       •    Delivery                 Nearly immediate
                       •    Installation
                       •    OS deployment
                       •    Application deployment




Tuesday, September 25, 12
How did we get here?



                     Cloud Deployment
                       •    Purchasing
                       •    Vendor build
                       •    Delivery                 Nearly immediate
                       •    Installation
                       •    OS deployment
                       •    Application deployment
                                                          Must be fast




Tuesday, September 25, 12
Why automate?


              Good Reasons:
       •      More agility and faster scalability
       •      Improved infrastructure documentation
       •      Better disaster recovery




Tuesday, September 25, 12
Why automate?


              Good Reasons:
       •      More agility and faster scalability
       •      Improved infrastructure documentation
       •      Better disaster recovery


              Really Good Reasons:
       •      Spend less time on monotonous tasks
       •      Spend more time solving interesting problems




Tuesday, September 25, 12
Chef Principles




Tuesday, September 25, 12
Chef Principles



                 • Idempotent




Tuesday, September 25, 12
Chef Principles



                 • Idempotent
                 • Reasonable




Tuesday, September 25, 12
Chef Principles



                 • Idempotent
                 • Reasonable
                 • Primitives




Tuesday, September 25, 12
Chef Principles



                 • Idempotent
                 • Reasonable
                 • Primitives
                 • Scalable



Tuesday, September 25, 12
Chef Principles



                 • Idempotent
                 • Reasonable
                 • Primitives
                 • Scalable
                 • Hackable


Tuesday, September 25, 12
Chef Principles



                 • Idempotent
                 • Reasonable
                 • Primitives
                 • Scalable
                 • Hackable
                 • Shareable
Tuesday, September 25, 12
What is Chef?




                 •      Configuration management language

                 •      Systems integration framework

                 •      API for your infrastructure


                                    http://www.flickr.com/photos/morville/3220961040/




Tuesday, September 25, 12
Application Programming Interface


                            The Meatcloud Manifesto

                      Give me an API or give me death.
                               -- Andrew Clay Shafer (@littleidea)




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes
           Users and Nodes authenticate as Clients




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes
           Users and Nodes authenticate as Clients
           Cookbooks contain Recipes




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes
           Users and Nodes authenticate as Clients
           Cookbooks contain Recipes
           Each node has a Run List




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes
           Users and Nodes authenticate as Clients
           Cookbooks contain Recipes
           Each node has a Run List
           A Run List is a list of Recipes to run




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes
           Users and Nodes authenticate as Clients
           Cookbooks contain Recipes
           Each node has a Run List
           A Run List is a list of Recipes to run
           Recipes can be grouped in a Role




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes
           Users and Nodes authenticate as Clients
           Cookbooks contain Recipes
           Each node has a Run List
           A Run List is a list of Recipes to run
           Recipes can be grouped in a Role
           Roles can also be added to a Run List




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes
           Users and Nodes authenticate as Clients
           Cookbooks contain Recipes
           Each node has a Run List
           A Run List is a list of Recipes to run
           Recipes can be grouped in a Role
           Roles can also be added to a Run List
           Nodes can be in Environments




Tuesday, September 25, 12
Chef Basics



           Chef manages Nodes
           Nodes have Attributes
           Users and Nodes authenticate as Clients
           Cookbooks contain Recipes
           Each node has a Run List
           A Run List is a list of Recipes to run
           Recipes can be grouped in a Role
           Roles can also be added to a Run List
           Nodes can be in Environments
           Data bags are... bags of data.



Tuesday, September 25, 12
Chef Basics Visualized



                client: srv01               client: srv02                    client: srv03




             node: srv01                     node: srv02                     node: srv03
     run_list: “role[web_server]”    run_list: “role[web_server]”     run_list: “role[db_server]”




                 role: web_server                                  role: db_server
   run_list: [“recipe[apache2]”, “recipe[php]” ]     run_list: [ “recipe[mysql]”, “recipe[nfs]” ]




Tuesday, September 25, 12
Chef Stacks



        chef-client         knife     chef-shell      chef-solo




                                    API




           Open Source          Hosted Chef        Private Chef

Tuesday, September 25, 12
Chef 10 Open Source Architecture




                             Chef Expander




Tuesday, September 25, 12
Resources



                 •      A Resource is something you manage
                        service, package, file, user, execute, git




Tuesday, September 25, 12
Resources



                 •      A Resource is something you manage
                        service, package, file, user, execute, git

                 •      Resources have actions
                        start, install, create, deploy

                 •      Resources can notify of other resources




Tuesday, September 25, 12
Resources



                 •      A Resource is something you manage
                        service, package, file, user, execute, git

                 •      Resources have actions
                        start, install, create, deploy

                 •      Resources can notify of other resources


                            cookbook_file “/etc/apache2/apache2.conf” do
                              source “apache2.conf”
                              owner “root”
                              group “root”
                              mode 0644
                              notifies :restart, “service[apache2]”
                            end



Tuesday, September 25, 12
Providers



                 •      A Provider performs the actions specified by the resource




Tuesday, September 25, 12
Providers



                 •      A Provider performs the actions specified by the resource

                 •      Each Resource can have multiple providers
                        package: apt, yum, macports...
                        service: upstart, windows, systemd...




Tuesday, September 25, 12
Providers



                 •      A Provider performs the actions specified by the resource

                 •      Each Resource can have multiple providers
                        package: apt, yum, macports...
                        service: upstart, windows, systemd...

                 •      Each platform (OS) has default Providers that can be overridden


                            package “sudo” do
                              provider Chef::Provider::Package::Yum
                              action :install
                            end




Tuesday, September 25, 12
A basic recipe

                            package “apache2” do
                              action :install
                            end




Tuesday, September 25, 12
A basic recipe

                            package “apache2” do
                              action :install
                            end

                            service “apache2” do
                              action :enable
                            end




Tuesday, September 25, 12
A basic recipe

                            package “apache2” do
                              action :install
                            end

                            service “apache2” do
                              action :enable
                            end

                            cookbook_file “/etc/apache2/apache2.conf” do
                              source “apache2.conf”
                              owner “root”
                              group “root”
                              mode 0644
                            end




Tuesday, September 25, 12
A basic recipe

                            package “apache2” do
                              action :install
                            end

                            service “apache2” do
                              action :enable
                            end

                            cookbook_file “/etc/apache2/apache2.conf” do
                              source “apache2.conf”
                              owner “root”
                              group “root”
                              mode 0644
                            end

                            service “apache2” do
                             action :start
                            end



Tuesday, September 25, 12
A basic recipe

                            package “apache2” do
                              action :install
                            end

                            service “apache2” do
                              action :enable
                              supports [ :restart, :reload, :status ]
                            end

                            cookbook_file “/etc/apache2/apache2.conf” do
                              source “apache2.conf”
                              owner “root”
                              group “root”
                              mode 0644
                              notifies :restart, “service[apache2]”
                            end

                            service “apache2” do
                             action :start
                            end

Tuesday, September 25, 12
Nagios Demo
                            • Download server cookbooks
                            • Install server
                            • Create fake nodes
                            • Update server



Tuesday, September 25, 12
Questions?

                               There is lots more to
                               learn about Chef at
                            http://wiki.opscode.com


Tuesday, September 25, 12

More Related Content

PDF
Symfony - Introduction
PDF
Andrew bond icera
PPTX
Serverless Toronto helps Startups
PDF
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020
PPTX
The Importance of Culture: Building and Sustaining Effective Engineering Org...
PDF
Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...
PDF
DOC
Analyse Ii
Symfony - Introduction
Andrew bond icera
Serverless Toronto helps Startups
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020
The Importance of Culture: Building and Sustaining Effective Engineering Org...
Implementing DevOps Automation: Best Practices & Common Mistakes - DevOps Eas...
Analyse Ii

Viewers also liked (20)

DOC
Trabajo Gbi
PDF
12 28 08 Weekly Prayer Sheet
PDF
India PR Wire May 15, 2009 Anxiety Grips Investors Ahead Of Election Verdict
PDF
03 29 09 Prayer Sheet Dave
ODP
Nagios Conference 2012 - Marcel Hecko - Importance of visual representation
DOC
ANALISIS DE INFORMACION
PPT
相關影片
PDF
Esquema 6
PDF
21st Century Airport Transportation Hubs
ODP
Nagios Conference 2012 - Nicholas Scott - Advanced Data Analytics For Nagios
DOC
PPSX
Memorial Presentation in Honor of June Grace (Brown) MacArthur
ODP
PPT
Umicore interview
DOC
98射擊成績
PDF
Nagios Conference 2013 - Avleen Vig - Nagios at Etsy
PPT
Technicle analesis
PPT
TYVM (Trailblazers 2012)
DOC
Anti Depressants Drugs
PDF
Nagios Conference 2012 - John Sellens - Nagios Indirection
Trabajo Gbi
12 28 08 Weekly Prayer Sheet
India PR Wire May 15, 2009 Anxiety Grips Investors Ahead Of Election Verdict
03 29 09 Prayer Sheet Dave
Nagios Conference 2012 - Marcel Hecko - Importance of visual representation
ANALISIS DE INFORMACION
相關影片
Esquema 6
21st Century Airport Transportation Hubs
Nagios Conference 2012 - Nicholas Scott - Advanced Data Analytics For Nagios
Memorial Presentation in Honor of June Grace (Brown) MacArthur
Umicore interview
98射擊成績
Nagios Conference 2013 - Avleen Vig - Nagios at Etsy
Technicle analesis
TYVM (Trailblazers 2012)
Anti Depressants Drugs
Nagios Conference 2012 - John Sellens - Nagios Indirection
Ad

Similar to Nagios Conference 2012 - Bryan McLellan - Using Nagios With Chef (20)

PDF
PFCongres 2012 - Rock Solid Deployment of PHP Apps
PDF
Codeworks'12 Rock Solid Deployment of PHP Apps
PDF
DevOps at ACCU 2012
PDF
Cloud Foundry, Spring and Vaadin
PDF
Devops what it means to me
PPTX
Continuous Delivery Applied
PPTX
Continuous Delivery Applied (AgileDC)
PPTX
Continuous delivery applied (RJUG)
PDF
Getting More from Your CI Server: Taking Hudson to the Next Level
PPTX
Continuous Delivery Applied (Agile Richmond)
PPTX
Continuous Delivery Applied
PDF
From ci to cd - LavaJug 2012
PDF
O futuro do cloud deployment
PDF
PaaS isn't Just for Developers
PPTX
Hp Fortify Cloud Application Security
PDF
DevOps Introduction @Cegeka
PDF
Devops, Secops, Opsec, DevSec *ops *.* ?
PPTX
[NetPonto] Arquitectura dos Serviços da plataforma Windows Azure
PDF
CLOUD LOCK-IN AND THE MYTH OF OPEN APIS at Structure 2012
PPTX
Architecting for continuous delivery (33rd Degree)
PFCongres 2012 - Rock Solid Deployment of PHP Apps
Codeworks'12 Rock Solid Deployment of PHP Apps
DevOps at ACCU 2012
Cloud Foundry, Spring and Vaadin
Devops what it means to me
Continuous Delivery Applied
Continuous Delivery Applied (AgileDC)
Continuous delivery applied (RJUG)
Getting More from Your CI Server: Taking Hudson to the Next Level
Continuous Delivery Applied (Agile Richmond)
Continuous Delivery Applied
From ci to cd - LavaJug 2012
O futuro do cloud deployment
PaaS isn't Just for Developers
Hp Fortify Cloud Application Security
DevOps Introduction @Cegeka
Devops, Secops, Opsec, DevSec *ops *.* ?
[NetPonto] Arquitectura dos Serviços da plataforma Windows Azure
CLOUD LOCK-IN AND THE MYTH OF OPEN APIS at Structure 2012
Architecting for continuous delivery (33rd Degree)
Ad

More from Nagios (20)

PPTX
Nagios XI Best Practices
PDF
Jesse Olson - Nagios Log Server Architecture Overview
PDF
Trevor McDonald - Nagios XI Under The Hood
PDF
Sean Falzon - Nagios - Resilient Notifications
PDF
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
PDF
Janice Singh - Writing Custom Nagios Plugins
PDF
Dave Williams - Nagios Log Server - Practical Experience
PDF
Mike Weber - Nagios and Group Deployment of Service Checks
PDF
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
PDF
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
PDF
Matt Bruzek - Monitoring Your Public Cloud With Nagios
PDF
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
PDF
Eric Loyd - Fractal Nagios
PDF
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
PDF
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
PPTX
Nagios World Conference 2015 - Scott Wilkerson Opening
PDF
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
PDF
Nagios Log Server - Features
PDF
Nagios Network Analyzer - Features
PPTX
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios XI Best Practices
Jesse Olson - Nagios Log Server Architecture Overview
Trevor McDonald - Nagios XI Under The Hood
Sean Falzon - Nagios - Resilient Notifications
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Janice Singh - Writing Custom Nagios Plugins
Dave Williams - Nagios Log Server - Practical Experience
Mike Weber - Nagios and Group Deployment of Service Checks
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Matt Bruzek - Monitoring Your Public Cloud With Nagios
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Eric Loyd - Fractal Nagios
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Nagios World Conference 2015 - Scott Wilkerson Opening
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nagios Log Server - Features
Nagios Network Analyzer - Features
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PDF
Empathic Computing: Creating Shared Understanding
PPTX
A Presentation on Artificial Intelligence
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation_ Review paper, used for researhc scholars
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Spectroscopy.pptx food analysis technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding
A Presentation on Artificial Intelligence
Dropbox Q2 2025 Financial Results & Investor Presentation
MIND Revenue Release Quarter 2 2025 Press Release
Assigned Numbers - 2025 - Bluetooth® Document
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Nagios Conference 2012 - Bryan McLellan - Using Nagios With Chef

  • 1. Configuring Nagios with Chef Bryan McLellan Technical Program Manager, Open Source btm@opscode.com / @btmspox Tuesday, September 25, 12
  • 2. Overview • Who am I? • Why automation • Introduction to Chef • Nagios Demo • Questions Tuesday, September 25, 12
  • 3. Who am I? • Chef Early developer, user, pundit • 10+ years in Systems Administration Computer repair, ISPs, Corporate IT, Web operations • Event Logistics Volunteer Traffic Control, Parking, Communications, Networking, Emergency Management • Hacker-Operator Trucks, Bikes, Radios, Tractors Tuesday, September 25, 12
  • 4. How did we get here? Bare Metal Deployment Tuesday, September 25, 12
  • 5. How did we get here? Bare Metal Deployment • Purchasing Tuesday, September 25, 12
  • 6. How did we get here? Bare Metal Deployment • Purchasing • Vendor build Tuesday, September 25, 12
  • 7. How did we get here? Bare Metal Deployment • Purchasing • Vendor build • Delivery Tuesday, September 25, 12
  • 8. How did we get here? Bare Metal Deployment • Purchasing • Vendor build • Delivery • Installation Tuesday, September 25, 12
  • 9. How did we get here? Bare Metal Deployment • Purchasing • Vendor build • Delivery • Installation • OS deployment Tuesday, September 25, 12
  • 10. How did we get here? Bare Metal Deployment • Purchasing • Vendor build • Delivery • Installation • OS deployment • Application deployment Tuesday, September 25, 12
  • 11. How did we get here? Bare Metal Deployment • Purchasing • Vendor build • Delivery Weeks? • Installation • OS deployment • Application deployment Tuesday, September 25, 12
  • 12. How did we get here? Cloud Deployment • Purchasing • Vendor build • Delivery Nearly immediate • Installation • OS deployment • Application deployment Tuesday, September 25, 12
  • 13. How did we get here? Cloud Deployment • Purchasing • Vendor build • Delivery Nearly immediate • Installation • OS deployment • Application deployment Must be fast Tuesday, September 25, 12
  • 14. Why automate? Good Reasons: • More agility and faster scalability • Improved infrastructure documentation • Better disaster recovery Tuesday, September 25, 12
  • 15. Why automate? Good Reasons: • More agility and faster scalability • Improved infrastructure documentation • Better disaster recovery Really Good Reasons: • Spend less time on monotonous tasks • Spend more time solving interesting problems Tuesday, September 25, 12
  • 17. Chef Principles • Idempotent Tuesday, September 25, 12
  • 18. Chef Principles • Idempotent • Reasonable Tuesday, September 25, 12
  • 19. Chef Principles • Idempotent • Reasonable • Primitives Tuesday, September 25, 12
  • 20. Chef Principles • Idempotent • Reasonable • Primitives • Scalable Tuesday, September 25, 12
  • 21. Chef Principles • Idempotent • Reasonable • Primitives • Scalable • Hackable Tuesday, September 25, 12
  • 22. Chef Principles • Idempotent • Reasonable • Primitives • Scalable • Hackable • Shareable Tuesday, September 25, 12
  • 23. What is Chef? • Configuration management language • Systems integration framework • API for your infrastructure http://www.flickr.com/photos/morville/3220961040/ Tuesday, September 25, 12
  • 24. Application Programming Interface The Meatcloud Manifesto Give me an API or give me death. -- Andrew Clay Shafer (@littleidea) Tuesday, September 25, 12
  • 25. Chef Basics Chef manages Nodes Tuesday, September 25, 12
  • 26. Chef Basics Chef manages Nodes Nodes have Attributes Tuesday, September 25, 12
  • 27. Chef Basics Chef manages Nodes Nodes have Attributes Users and Nodes authenticate as Clients Tuesday, September 25, 12
  • 28. Chef Basics Chef manages Nodes Nodes have Attributes Users and Nodes authenticate as Clients Cookbooks contain Recipes Tuesday, September 25, 12
  • 29. Chef Basics Chef manages Nodes Nodes have Attributes Users and Nodes authenticate as Clients Cookbooks contain Recipes Each node has a Run List Tuesday, September 25, 12
  • 30. Chef Basics Chef manages Nodes Nodes have Attributes Users and Nodes authenticate as Clients Cookbooks contain Recipes Each node has a Run List A Run List is a list of Recipes to run Tuesday, September 25, 12
  • 31. Chef Basics Chef manages Nodes Nodes have Attributes Users and Nodes authenticate as Clients Cookbooks contain Recipes Each node has a Run List A Run List is a list of Recipes to run Recipes can be grouped in a Role Tuesday, September 25, 12
  • 32. Chef Basics Chef manages Nodes Nodes have Attributes Users and Nodes authenticate as Clients Cookbooks contain Recipes Each node has a Run List A Run List is a list of Recipes to run Recipes can be grouped in a Role Roles can also be added to a Run List Tuesday, September 25, 12
  • 33. Chef Basics Chef manages Nodes Nodes have Attributes Users and Nodes authenticate as Clients Cookbooks contain Recipes Each node has a Run List A Run List is a list of Recipes to run Recipes can be grouped in a Role Roles can also be added to a Run List Nodes can be in Environments Tuesday, September 25, 12
  • 34. Chef Basics Chef manages Nodes Nodes have Attributes Users and Nodes authenticate as Clients Cookbooks contain Recipes Each node has a Run List A Run List is a list of Recipes to run Recipes can be grouped in a Role Roles can also be added to a Run List Nodes can be in Environments Data bags are... bags of data. Tuesday, September 25, 12
  • 35. Chef Basics Visualized client: srv01 client: srv02 client: srv03 node: srv01 node: srv02 node: srv03 run_list: “role[web_server]” run_list: “role[web_server]” run_list: “role[db_server]” role: web_server role: db_server run_list: [“recipe[apache2]”, “recipe[php]” ] run_list: [ “recipe[mysql]”, “recipe[nfs]” ] Tuesday, September 25, 12
  • 36. Chef Stacks chef-client knife chef-shell chef-solo API Open Source Hosted Chef Private Chef Tuesday, September 25, 12
  • 37. Chef 10 Open Source Architecture Chef Expander Tuesday, September 25, 12
  • 38. Resources • A Resource is something you manage service, package, file, user, execute, git Tuesday, September 25, 12
  • 39. Resources • A Resource is something you manage service, package, file, user, execute, git • Resources have actions start, install, create, deploy • Resources can notify of other resources Tuesday, September 25, 12
  • 40. Resources • A Resource is something you manage service, package, file, user, execute, git • Resources have actions start, install, create, deploy • Resources can notify of other resources cookbook_file “/etc/apache2/apache2.conf” do source “apache2.conf” owner “root” group “root” mode 0644 notifies :restart, “service[apache2]” end Tuesday, September 25, 12
  • 41. Providers • A Provider performs the actions specified by the resource Tuesday, September 25, 12
  • 42. Providers • A Provider performs the actions specified by the resource • Each Resource can have multiple providers package: apt, yum, macports... service: upstart, windows, systemd... Tuesday, September 25, 12
  • 43. Providers • A Provider performs the actions specified by the resource • Each Resource can have multiple providers package: apt, yum, macports... service: upstart, windows, systemd... • Each platform (OS) has default Providers that can be overridden package “sudo” do provider Chef::Provider::Package::Yum action :install end Tuesday, September 25, 12
  • 44. A basic recipe package “apache2” do action :install end Tuesday, September 25, 12
  • 45. A basic recipe package “apache2” do action :install end service “apache2” do action :enable end Tuesday, September 25, 12
  • 46. A basic recipe package “apache2” do action :install end service “apache2” do action :enable end cookbook_file “/etc/apache2/apache2.conf” do source “apache2.conf” owner “root” group “root” mode 0644 end Tuesday, September 25, 12
  • 47. A basic recipe package “apache2” do action :install end service “apache2” do action :enable end cookbook_file “/etc/apache2/apache2.conf” do source “apache2.conf” owner “root” group “root” mode 0644 end service “apache2” do action :start end Tuesday, September 25, 12
  • 48. A basic recipe package “apache2” do action :install end service “apache2” do action :enable supports [ :restart, :reload, :status ] end cookbook_file “/etc/apache2/apache2.conf” do source “apache2.conf” owner “root” group “root” mode 0644 notifies :restart, “service[apache2]” end service “apache2” do action :start end Tuesday, September 25, 12
  • 49. Nagios Demo • Download server cookbooks • Install server • Create fake nodes • Update server Tuesday, September 25, 12
  • 50. Questions? There is lots more to learn about Chef at http://wiki.opscode.com Tuesday, September 25, 12