SlideShare uma empresa Scribd logo
1 de 53
(A Very Quick) Intro To Chef


       PICConf ’12
       Mandi Walls
    mandi@opscode.com
whoami




•   Mandi Walls

•   mandi@opscode.com

•   @lnxchk
Chef is Configuration Management




A technical domain
revolving around
building and
managing
infrastructure
programmatically       http://www.flickr.com/photos/neilt/530198191/
Enable the reconstruction
   of the business from
nothing but a source code
repository, an application
  data backup, and bare
     metal resources.
Avoiding Snowflakes




• “That one host” you know you can’t rebuild if
  it dies
• Untracked changes to systems, new
  configurations
• Collections of bash, perl, python, whatever
• Cheatsheets, wiki pages, folklore on how to
  build systems
Infrastructure as Code




• Logically group all the changes needed
  to get systems into working order
• All the bits and pieces that you have to
  remember to do after the OS is loaded
• 1.. N.. infinity
• Integrate systems programmatically
Managing the Various Pieces of Your
                       Environment




                         •Provision
                         •Configure
                         •Integrate
Managing the Various Pieces of Your
                                                     Environment


              Load Balancer
                                                       •Provision


App Server   { {                  App Server
                                                       •Configure
                                                       •Integrate


             Database Master
What to Configure?
Goals!




• Idempotence
• Reasonability
• Sane Defaults
• Coordination
• Flexibility
Chef is Ruby




• Internal DSL
• Chef resources look like Ruby objects
• Chef can be extended using Ruby
• Chef tools like ohai and knife can also
  be extended using Ruby
Chef Architecture




      •Chef Server
      •Chef Users
      •Chef Nodes
      •Knife
      •chef-client
Chef Nodes




• Your hosts are “nodes” in Chef
• They are the authority on all info about
  themselves
• This info is stored in a Ruby object
  called “node” too
• Characteristics about the node are
  called attributes
Node Object

{
    "name": "www1.example.com",        • JSON
    "json_class": "Chef::Node",        • Pushed to
    "chef_type": "node",                 Chef Server
    "chef_environment": "_default",    • Indexed for
                                         Searching
    "automatic": { ... },
    "default": { ... },
    "normal": { ... },
    "override": { ... },
    "run_list": [ ... ]
}
Chef Building Blocks




• Resources
• Recipes
• Cookbooks
• Roles
• Environments
Chef Resources

package "haproxy" do
  action :install
end

template "/etc/haproxy/haproxy.cfg" do
  source "haproxy.cfg.erb"
  owner "root"
  group "root"
  mode 0644
  notifies :restart, "service[haproxy]"
end

service "haproxy" do
  supports :restart => true
  action [:enable, :start]
end
Chef Resources

                 package "haproxy" do
                   action :install
                 end
• Have a type.   template "/etc/haproxy/haproxy.cfg" do
                   source "haproxy.cfg.erb"
                   owner "root"
                   group "root"
                   mode 0644
                   notifies :restart, "service[haproxy]"
                 end

                 service "haproxy" do
                   supports :restart => true
                   action [:enable, :start]
                 end
Chef Resources

                 package "haproxy" do
                   action :install
                 end
• Have a type.   template "/etc/haproxy/haproxy.cfg" do
• Have a name.     source "haproxy.cfg.erb"
                   owner "root"
                   group "root"
                   mode 0644
                   notifies :restart, "service[haproxy]"
                 end

                 service "haproxy" do
                   supports :restart => true
                   action [:enable, :start]
                 end
Chef Resources

                     package "haproxy" do
                       action :install
                     end
• Have a type.       template "/etc/haproxy/haproxy.cfg" do
• Have a name.         source "haproxy.cfg.erb"

• Have parameters.
                       owner "root"
                       group "root"
                       mode 0644
                       notifies :restart, "service[haproxy]"
                     end

                     service "haproxy" do
                       supports :restart => true
                       action [:enable, :start]
                     end
Chef Resources

                             package "haproxy" do
                               action :install
                             end
• Have a type.               template "/etc/haproxy/haproxy.cfg" do
• Have a name.                 source "haproxy.cfg.erb"

• Have parameters.
                               owner "root"
                               group "root"

• Take action to put the
                               mode 0644
                               notifies :restart, "service[haproxy]"
  resource in the declared   end
  state.                     service "haproxy" do
                               supports :restart => true
                               action [:enable, :start]
                             end
Chef Resources

                             package "haproxy" do
                               action :install
                             end
• Have a type.               template "/etc/haproxy/haproxy.cfg" do
• Have a name.                 source "haproxy.cfg.erb"

• Have parameters.
                               owner "root"
                               group "root"

• Take action to put the
                               mode 0644
                               notifies :restart, "service[haproxy]"
  resource in the declared   end
  state.                     service "haproxy" do

• Can send notifications to     supports :restart => true
                               action [:enable, :start]
  other resources.           end
Resources and Providers




Resources take action
  through Providers
Providers are Behind the Scenes




package “haproxy”
                    {   yum install haproxy
                        apt-get install haproxy
                        pacman sync haproxy
                        pkg_add -r haproxy
Recipes
Recipes are Collections of Resources


package "hadoop-#{hadoop_version}-namenode" do
  action :install
end
template "/usr/lib/hadoop/conf/core-site.xml" do
  source "core-site_xml.erb"
  owner "hadoop"
  group "hadoop"
  mode 0644
end
service "hadoop-#{hadoop_version}-namenode" do
  supports :restart => true, :start => true, :stop => true
end
Cookbooks are Collections of Recipes



• Each cookbook can have multiple
  recipes
  • namenode, datanode, jobtracker,
    worker
  • solr_master, solr_slave
• Configuration files, templates, libraries
 • server.xml
 • hdfs-site.xml
                               http://www.flickr.com/photos/pinkpollyanna/222517565/sizes/m/in/photostream/
Run Lists


• Tell the nodes what recipes to run
  Node Name:      ip-10-93-42-234.ec2.internal
  Environment: _default
  FQDN:           ip-10-93-42-234.ec2.internal
  IP:             23.22.80.76
  Run List:       role[base], role[webserver]
  Roles:          base, webserver
  Recipes:        apt, chef-client, apache2, webserver
  Platform:       ubuntu 10.04
Attributes




• Information about the node, the
  applications, etc
• Set by ohai!
• Set by cookbooks, roles, environments,
  or directly in recipes
• Applied with specific precedence
Node Attributes

$ knife node show ip-10-93-42-234.ec2.internal -a ec2
ec2:
  ...
  hostname:                         ip-10-93-42-234.ec2.internal
  instance_id:                      i-75b16813
  instance_type:                    m1.small
  kernel_id:                        aki-407d9529
  local_hostname:                   ip-10-93-42-234.ec2.internal
  local_ipv4:                       10.93.42.234
  placement_availability_zone:      us-east-1b
  profile:                          default-paravirtual
  public_hostname:                  ec2-23-22-80-76.compute-1.amazonaws.com
  public_ipv4:                      23.22.80.76
Non-ohai Attributes


• Attributes can also come from roles, cookbooks,
   and recipes
• Used for settings needed by the configuration

set['apache']['package'] =   "httpd"
set['apache']['dir']     =   "/etc/httpd"
set['apache']['log_dir'] =   "/var/log/httpd"
set['apache']['error_log']   = "error.log"
set['apache']['user']    =   "apache"
set['apache']['group']   =   "apache"
set['apache']['binary'] =    "/usr/sbin/httpd"
set['apache']['icondir'] =   "/var/www/icons"
set['apache']['cache_dir']   = "/var/cache/httpd"
Roles


name "base"
description "Base role for all
servers"
run_list(
! "recipe[apt]",
! "recipe[fail2ban]",
! "recipe[chef-client]"
)


                           http://www.flickr.com/photos/ulteriorepicure/177506395/sizes/m/in/photostream/
Basic Resources
Basic Resources: package


  package "tar" do
    version "1.16.1-1"
    action :install
  end

  package "portmap" do
    action :remove
  end

• Providers determine how to manage the
  packages on every platform
Basic Resources: template


• Templates are rendered when the Chef client
  runs on the node
• Interprets the values of variables, search
  results, etc, to create dynamic configurations

template "/tmp/config.conf" do
  source "config.conf.erb"
  variables(
    :config_var => node[:configs][:config_var]
  )
end
Basic Resources: cookbook_file



cookbook_file "/tmp/testfile" do
  source "testfile"
  owner “root”
  group “root”
  mode "0644"
end
Basic Resources: directory


directory "/tmp/something" do
  owner "root"
  group "root"
  mode "0755"
  action :create
end
directory "C:tmpsomething.txt" do
  rights :full_control, "DOMAINUser"
  inherits false
  action :create
end
Basic Resources: service



service "apache2" do
  supports :restart => true
  action :enable
end

template "/etc/apache2/apache2.conf" do
  # ... other parameters
  notifies :restart, "service[apache2]"
end
Other Common Resources



• User, Group
• Cron
• Execute: run arbitrary commands
• File: files already on the node
• Env (on Windows)
• HTTP Request
• Link
Reasoning About
 Infrastructure
Reflection of Reality
Deciding on Cookbooks and Roles


• Each service in your infrastructure usually has its own
  cookbook, or may have a collection of cookbooks in a
  role
• A set of Tomcat servers may have a cookbook for java,
  a cookbook for Tomcat, and a cookbook for application
  code
• The java and tomcat cookbooks can be reused in
  multiple applications
• A common practice is to include a base role for
  universal configurations that should apply to all of your
  nodes
  • Security settings, DNS servers, local file repositories
• Members of the Chef community share cookbooks at
Environments

• Environments allow you to think about not just
  groups of nodes running applications, but also
  the larger infrastructure
• Every node belongs to only one environment
• Environments can be used to specify which
  version of a cookbook to use on any node
  assigned to the environment
• A common use of environments is assigning
  nodes to “dev”, “qa”, “staging”, and “production”
  • Each environment can be configured to use a
     different version of the available cookbooks
• Attributes allow you to change settings based on
  the environment
Reusability

Dev Environment
Node Name:     devhost1
Environment:   dev
FQDN:          devhost1.mydomain.com
IP:            192.168.1.100
Run List:      role[base], role[solr_master]
Roles:         base, solr_master
Recipes:       apt, fail2ban, chef-client, solr, solr::master
Platform:      ubuntu 10.04

Prod Environment
Node Name:     solr1
Environment:   prod
FQDN:          solr1.mydomain.com
IP:            192.168.10.50
Run List:      role[base], role[solr_master]
Roles:         base, solr_master
Recipes:       apt, fail2ban, chef-client, solr, solr::master
Platform:      ubuntu 10.04
Search

 • All node data is indexed on the Chef server
 • These indexes are available for searching from
   knife and recipes
 • Use search results to dynamically configure
   integrated resources


search(:node, "role:webserver") do |match|
  puts match["ipaddress"]
end
Managing
Infrastructure as Code
Chef Code Workflow



•   You build recipes, cookbooks, roles, environments,
    etc as files in your local Chef repository
•   Check your code into source code control
•   Upload your infrastructure to the Chef server with
    knife
•   Nodes get their configuration information when
    they run chef-client
•   Nodes can run chef-client as often or as rarely as
    you need
•   You can test in a variety of ways that suit your
    infrastructure best
Incorporating Version Control System




• Employ the distributed version control
  system of your choice
• Use what your team already knows! Chef
  doesn’t require a specific system
• Git is popular, but SVN, Perforce, others
  are used as well
• Decide on your testing, versioning, code
  review practices as suit your team’s
  needs
Try It Out
How to Get Chef




• Hosted Chef is a SaaS product hosted by
  Opscode
• http://manage.opscode.com
• You can create an account and add up to five
  nodes for free to try out chef
• Our new installer makes installing Chef on
  nodes super easy!
  • http://www.opscode.com/chef/install
  • Provides a full stack, don’t worry about Ruby
     version issues
More Info on Getting Started



• Our wiki: http://wiki.opscode.com
• Fast start guide:
  • http://wiki.opscode.com/display/chef/Fast+Start
     +Guide
• Our Community site: http://community.opscode.com
• Cookbooks in our Github account: http://github.com/
  opscode/cookbooks
• The materials for our 3-day Chef Fundamentals class are
  online:
  • https://github.com/opscode/chef-fundamentals
Supported Platforms




Ubuntu (10.04, 10.10, 11.04, 11.10)
•Debian (5.0, 6.0)
•RHEL & CentOS (5.x, 6.x)
•Fedora 10+
•Mac OS X (10.4, 10.5, 10.6)
•Windows 7
•Windows Server 2003 R2, 2008 R2
Thanks, PICConf!!




• mandi walls
• mandi@opscode.com
• @lnxchk
Questions?




• On freenode: #chef and #chef-hacking
• http://lists.opscode.com
• http://tickets.opscode.com
• http://help.opscode.com
• @opscode and @opscode_status on Twitter

Mais conteúdo relacionado

Mais procurados

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
 
Preppingthekitchen 1.0.3
Preppingthekitchen 1.0.3Preppingthekitchen 1.0.3
Preppingthekitchen 1.0.3Sean OMeara
 
Chef for OpenStack - OpenStack Fall 2012 Summit
Chef for OpenStack  - OpenStack Fall 2012 SummitChef for OpenStack  - OpenStack Fall 2012 Summit
Chef for OpenStack - OpenStack Fall 2012 SummitMatt Ray
 
Chef & OpenStack: OSCON 2014
Chef & OpenStack: OSCON 2014Chef & OpenStack: OSCON 2014
Chef & OpenStack: OSCON 2014Matt Ray
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Chef
 
Cooking 5 Star Infrastructure with Chef
Cooking 5 Star Infrastructure with ChefCooking 5 Star Infrastructure with Chef
Cooking 5 Star Infrastructure with ChefG. Ryan Fawcett
 
Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Matt Ray
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...Yury Bushmelev
 
AWS ElasticBeanstalk Advanced configuration
AWS ElasticBeanstalk Advanced configurationAWS ElasticBeanstalk Advanced configuration
AWS ElasticBeanstalk Advanced configurationLionel LONKAP TSAMBA
 
Manage and Deploy your sites with Drush
Manage and Deploy your sites with DrushManage and Deploy your sites with Drush
Manage and Deploy your sites with DrushAmazee Labs
 
GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPPavel Tyk
 
A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices Nebulaworks
 
Open Source Logging and Monitoring Tools
Open Source Logging and Monitoring ToolsOpen Source Logging and Monitoring Tools
Open Source Logging and Monitoring ToolsPhase2
 
Getting Started with Ansible
Getting Started with AnsibleGetting Started with Ansible
Getting Started with Ansibleahamilton55
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopWalter Heck
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHPHari K T
 

Mais procurados (18)

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
 
Preppingthekitchen 1.0.3
Preppingthekitchen 1.0.3Preppingthekitchen 1.0.3
Preppingthekitchen 1.0.3
 
Chef for OpenStack - OpenStack Fall 2012 Summit
Chef for OpenStack  - OpenStack Fall 2012 SummitChef for OpenStack  - OpenStack Fall 2012 Summit
Chef for OpenStack - OpenStack Fall 2012 Summit
 
Chef & OpenStack: OSCON 2014
Chef & OpenStack: OSCON 2014Chef & OpenStack: OSCON 2014
Chef & OpenStack: OSCON 2014
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
 
Cooking 5 Star Infrastructure with Chef
Cooking 5 Star Infrastructure with ChefCooking 5 Star Infrastructure with Chef
Cooking 5 Star Infrastructure with Chef
 
Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...
 
Chef
ChefChef
Chef
 
AWS ElasticBeanstalk Advanced configuration
AWS ElasticBeanstalk Advanced configurationAWS ElasticBeanstalk Advanced configuration
AWS ElasticBeanstalk Advanced configuration
 
Manage and Deploy your sites with Drush
Manage and Deploy your sites with DrushManage and Deploy your sites with Drush
Manage and Deploy your sites with Drush
 
Refactoring terraform
Refactoring terraformRefactoring terraform
Refactoring terraform
 
GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APP
 
A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices
 
Open Source Logging and Monitoring Tools
Open Source Logging and Monitoring ToolsOpen Source Logging and Monitoring Tools
Open Source Logging and Monitoring Tools
 
Getting Started with Ansible
Getting Started with AnsibleGetting Started with Ansible
Getting Started with Ansible
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
 

Destaque

Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesIntroduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesAmazon Web Services
 
Lessons Learned From Cloud Migrations
Lessons Learned From Cloud MigrationsLessons Learned From Cloud Migrations
Lessons Learned From Cloud MigrationsMandi Walls
 
Introduction to Amazon Web Services
Introduction to Amazon Web ServicesIntroduction to Amazon Web Services
Introduction to Amazon Web ServicesRobert Greiner
 
Introduction to Amazon Web Services
Introduction to Amazon Web ServicesIntroduction to Amazon Web Services
Introduction to Amazon Web ServicesAmazon Web Services
 

Destaque (7)

Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web ServicesIntroduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services
 
Overview of Amazon Web Services
Overview of Amazon Web ServicesOverview of Amazon Web Services
Overview of Amazon Web Services
 
What is AWS?
What is AWS?What is AWS?
What is AWS?
 
Lessons Learned From Cloud Migrations
Lessons Learned From Cloud MigrationsLessons Learned From Cloud Migrations
Lessons Learned From Cloud Migrations
 
Introduction to Amazon Web Services
Introduction to Amazon Web ServicesIntroduction to Amazon Web Services
Introduction to Amazon Web Services
 
Introduction to Amazon Web Services
Introduction to Amazon Web ServicesIntroduction to Amazon Web Services
Introduction to Amazon Web Services
 

Semelhante a Picconf12

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.
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chefkevsmith
 
SCALE 2011 Deploying OpenStack with Chef
SCALE 2011 Deploying OpenStack with ChefSCALE 2011 Deploying OpenStack with Chef
SCALE 2011 Deploying OpenStack with ChefMatt Ray
 
Hadoop 20111117
Hadoop 20111117Hadoop 20111117
Hadoop 20111117exsuns
 
Debugging Hive with Hadoop-in-the-Cloud
Debugging Hive with Hadoop-in-the-CloudDebugging Hive with Hadoop-in-the-Cloud
Debugging Hive with Hadoop-in-the-CloudSoam Acharya
 
De-Bugging Hive with Hadoop-in-the-Cloud
De-Bugging Hive with Hadoop-in-the-CloudDe-Bugging Hive with Hadoop-in-the-Cloud
De-Bugging Hive with Hadoop-in-the-CloudDataWorks Summit
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Jennifer Davis
 
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.
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with ChefJohn Osborne
 
Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...
Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...
Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...rhatr
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with ChefBryan McLellan
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasaggarrett honeycutt
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setupMohammad_Tariq
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansibleKhizer Naeem
 
Agiles Peru 2019 - Infrastructure As Code
Agiles Peru 2019 - Infrastructure As CodeAgiles Peru 2019 - Infrastructure As Code
Agiles Peru 2019 - Infrastructure As CodeMario IC
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 

Semelhante a Picconf12 (20)

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...
 
Configuration management with Chef
Configuration management with ChefConfiguration management with Chef
Configuration management with Chef
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
SCALE 2011 Deploying OpenStack with Chef
SCALE 2011 Deploying OpenStack with ChefSCALE 2011 Deploying OpenStack with Chef
SCALE 2011 Deploying OpenStack with Chef
 
Hadoop 20111117
Hadoop 20111117Hadoop 20111117
Hadoop 20111117
 
Debugging Hive with Hadoop-in-the-Cloud
Debugging Hive with Hadoop-in-the-CloudDebugging Hive with Hadoop-in-the-Cloud
Debugging Hive with Hadoop-in-the-Cloud
 
De-Bugging Hive with Hadoop-in-the-Cloud
De-Bugging Hive with Hadoop-in-the-CloudDe-Bugging Hive with Hadoop-in-the-Cloud
De-Bugging Hive with Hadoop-in-the-Cloud
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
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
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
 
Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...
Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...
Building Google-in-a-box: using Apache SolrCloud and Bigtop to index your big...
 
Chef advance
Chef advanceChef advance
Chef advance
 
Chef advance
Chef advanceChef advance
Chef advance
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setup
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
Agiles Peru 2019 - Infrastructure As Code
Agiles Peru 2019 - Infrastructure As CodeAgiles Peru 2019 - Infrastructure As Code
Agiles Peru 2019 - Infrastructure As Code
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Full-Stack CakePHP Deployment
Full-Stack CakePHP DeploymentFull-Stack CakePHP Deployment
Full-Stack CakePHP Deployment
 

Mais de Mandi Walls

DOD Raleigh Gamedays with Chaos Engineering.pdf
DOD Raleigh Gamedays with Chaos Engineering.pdfDOD Raleigh Gamedays with Chaos Engineering.pdf
DOD Raleigh Gamedays with Chaos Engineering.pdfMandi Walls
 
Addo reducing trauma in organizations with SLOs and chaos engineering
Addo  reducing trauma in organizations with SLOs and chaos engineeringAddo  reducing trauma in organizations with SLOs and chaos engineering
Addo reducing trauma in organizations with SLOs and chaos engineeringMandi Walls
 
Full Service Ownership
Full Service OwnershipFull Service Ownership
Full Service OwnershipMandi Walls
 
PagerDuty: Best Practices for On Call Teams
PagerDuty: Best Practices for On Call TeamsPagerDuty: Best Practices for On Call Teams
PagerDuty: Best Practices for On Call TeamsMandi Walls
 
InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020Mandi Walls
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Mandi Walls
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityMandi Walls
 
Adding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xAdding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xMandi Walls
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Mandi Walls
 
BuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopBuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopMandi Walls
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018Mandi Walls
 
DevOpsDays InSpec Workshop
DevOpsDays InSpec WorkshopDevOpsDays InSpec Workshop
DevOpsDays InSpec WorkshopMandi Walls
 
Adding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpecAdding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpecMandi Walls
 
InSpec - June 2018 at Open28.be
InSpec - June 2018 at Open28.beInSpec - June 2018 at Open28.be
InSpec - June 2018 at Open28.beMandi Walls
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker budMandi Walls
 
Ingite Slides for InSpec
Ingite Slides for InSpecIngite Slides for InSpec
Ingite Slides for InSpecMandi Walls
 
Habitat at LinuxLab IT
Habitat at LinuxLab ITHabitat at LinuxLab IT
Habitat at LinuxLab ITMandi Walls
 
InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017Mandi Walls
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Mandi Walls
 
InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017Mandi Walls
 

Mais de Mandi Walls (20)

DOD Raleigh Gamedays with Chaos Engineering.pdf
DOD Raleigh Gamedays with Chaos Engineering.pdfDOD Raleigh Gamedays with Chaos Engineering.pdf
DOD Raleigh Gamedays with Chaos Engineering.pdf
 
Addo reducing trauma in organizations with SLOs and chaos engineering
Addo  reducing trauma in organizations with SLOs and chaos engineeringAddo  reducing trauma in organizations with SLOs and chaos engineering
Addo reducing trauma in organizations with SLOs and chaos engineering
 
Full Service Ownership
Full Service OwnershipFull Service Ownership
Full Service Ownership
 
PagerDuty: Best Practices for On Call Teams
PagerDuty: Best Practices for On Call TeamsPagerDuty: Best Practices for On Call Teams
PagerDuty: Best Practices for On Call Teams
 
InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020InSpec at DevOps ATL Meetup January 22, 2020
InSpec at DevOps ATL Meetup January 22, 2020
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure Security
 
Adding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17xAdding Security to Your Workflow With InSpec - SCaLE17x
Adding Security to Your Workflow With InSpec - SCaLE17x
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
 
BuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec WorkshopBuildStuff.LT 2018 InSpec Workshop
BuildStuff.LT 2018 InSpec Workshop
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018
 
DevOpsDays InSpec Workshop
DevOpsDays InSpec WorkshopDevOpsDays InSpec Workshop
DevOpsDays InSpec Workshop
 
Adding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpecAdding Security and Compliance to Your Workflow with InSpec
Adding Security and Compliance to Your Workflow with InSpec
 
InSpec - June 2018 at Open28.be
InSpec - June 2018 at Open28.beInSpec - June 2018 at Open28.be
InSpec - June 2018 at Open28.be
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
 
Ingite Slides for InSpec
Ingite Slides for InSpecIngite Slides for InSpec
Ingite Slides for InSpec
 
Habitat at LinuxLab IT
Habitat at LinuxLab ITHabitat at LinuxLab IT
Habitat at LinuxLab IT
 
InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017
 
InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017InSpec Workflow for DevOpsDays Riga 2017
InSpec Workflow for DevOpsDays Riga 2017
 

Último

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

Picconf12

  • 1. (A Very Quick) Intro To Chef PICConf ’12 Mandi Walls mandi@opscode.com
  • 2. whoami • Mandi Walls • mandi@opscode.com • @lnxchk
  • 3. Chef is Configuration Management A technical domain revolving around building and managing infrastructure programmatically http://www.flickr.com/photos/neilt/530198191/
  • 4. Enable the reconstruction of the business from nothing but a source code repository, an application data backup, and bare metal resources.
  • 5. Avoiding Snowflakes • “That one host” you know you can’t rebuild if it dies • Untracked changes to systems, new configurations • Collections of bash, perl, python, whatever • Cheatsheets, wiki pages, folklore on how to build systems
  • 6. Infrastructure as Code • Logically group all the changes needed to get systems into working order • All the bits and pieces that you have to remember to do after the OS is loaded • 1.. N.. infinity • Integrate systems programmatically
  • 7. Managing the Various Pieces of Your Environment •Provision •Configure •Integrate
  • 8. Managing the Various Pieces of Your Environment Load Balancer •Provision App Server { { App Server •Configure •Integrate Database Master
  • 10. Goals! • Idempotence • Reasonability • Sane Defaults • Coordination • Flexibility
  • 11. Chef is Ruby • Internal DSL • Chef resources look like Ruby objects • Chef can be extended using Ruby • Chef tools like ohai and knife can also be extended using Ruby
  • 12. Chef Architecture •Chef Server •Chef Users •Chef Nodes •Knife •chef-client
  • 13. Chef Nodes • Your hosts are “nodes” in Chef • They are the authority on all info about themselves • This info is stored in a Ruby object called “node” too • Characteristics about the node are called attributes
  • 14. Node Object { "name": "www1.example.com", • JSON "json_class": "Chef::Node", • Pushed to "chef_type": "node", Chef Server "chef_environment": "_default", • Indexed for Searching "automatic": { ... }, "default": { ... }, "normal": { ... }, "override": { ... }, "run_list": [ ... ] }
  • 15. Chef Building Blocks • Resources • Recipes • Cookbooks • Roles • Environments
  • 16. Chef Resources package "haproxy" do action :install end template "/etc/haproxy/haproxy.cfg" do source "haproxy.cfg.erb" owner "root" group "root" mode 0644 notifies :restart, "service[haproxy]" end service "haproxy" do supports :restart => true action [:enable, :start] end
  • 17. Chef Resources package "haproxy" do action :install end • Have a type. template "/etc/haproxy/haproxy.cfg" do source "haproxy.cfg.erb" owner "root" group "root" mode 0644 notifies :restart, "service[haproxy]" end service "haproxy" do supports :restart => true action [:enable, :start] end
  • 18. Chef Resources package "haproxy" do action :install end • Have a type. template "/etc/haproxy/haproxy.cfg" do • Have a name. source "haproxy.cfg.erb" owner "root" group "root" mode 0644 notifies :restart, "service[haproxy]" end service "haproxy" do supports :restart => true action [:enable, :start] end
  • 19. Chef Resources package "haproxy" do action :install end • Have a type. template "/etc/haproxy/haproxy.cfg" do • Have a name. source "haproxy.cfg.erb" • Have parameters. owner "root" group "root" mode 0644 notifies :restart, "service[haproxy]" end service "haproxy" do supports :restart => true action [:enable, :start] end
  • 20. Chef Resources package "haproxy" do action :install end • Have a type. template "/etc/haproxy/haproxy.cfg" do • Have a name. source "haproxy.cfg.erb" • Have parameters. owner "root" group "root" • Take action to put the mode 0644 notifies :restart, "service[haproxy]" resource in the declared end state. service "haproxy" do supports :restart => true action [:enable, :start] end
  • 21. Chef Resources package "haproxy" do action :install end • Have a type. template "/etc/haproxy/haproxy.cfg" do • Have a name. source "haproxy.cfg.erb" • Have parameters. owner "root" group "root" • Take action to put the mode 0644 notifies :restart, "service[haproxy]" resource in the declared end state. service "haproxy" do • Can send notifications to supports :restart => true action [:enable, :start] other resources. end
  • 22. Resources and Providers Resources take action through Providers
  • 23. Providers are Behind the Scenes package “haproxy” { yum install haproxy apt-get install haproxy pacman sync haproxy pkg_add -r haproxy
  • 25. Recipes are Collections of Resources package "hadoop-#{hadoop_version}-namenode" do action :install end template "/usr/lib/hadoop/conf/core-site.xml" do source "core-site_xml.erb" owner "hadoop" group "hadoop" mode 0644 end service "hadoop-#{hadoop_version}-namenode" do supports :restart => true, :start => true, :stop => true end
  • 26. Cookbooks are Collections of Recipes • Each cookbook can have multiple recipes • namenode, datanode, jobtracker, worker • solr_master, solr_slave • Configuration files, templates, libraries • server.xml • hdfs-site.xml http://www.flickr.com/photos/pinkpollyanna/222517565/sizes/m/in/photostream/
  • 27. Run Lists • Tell the nodes what recipes to run Node Name: ip-10-93-42-234.ec2.internal Environment: _default FQDN: ip-10-93-42-234.ec2.internal IP: 23.22.80.76 Run List: role[base], role[webserver] Roles: base, webserver Recipes: apt, chef-client, apache2, webserver Platform: ubuntu 10.04
  • 28. Attributes • Information about the node, the applications, etc • Set by ohai! • Set by cookbooks, roles, environments, or directly in recipes • Applied with specific precedence
  • 29. Node Attributes $ knife node show ip-10-93-42-234.ec2.internal -a ec2 ec2: ... hostname: ip-10-93-42-234.ec2.internal instance_id: i-75b16813 instance_type: m1.small kernel_id: aki-407d9529 local_hostname: ip-10-93-42-234.ec2.internal local_ipv4: 10.93.42.234 placement_availability_zone: us-east-1b profile: default-paravirtual public_hostname: ec2-23-22-80-76.compute-1.amazonaws.com public_ipv4: 23.22.80.76
  • 30. Non-ohai Attributes • Attributes can also come from roles, cookbooks, and recipes • Used for settings needed by the configuration set['apache']['package'] = "httpd" set['apache']['dir'] = "/etc/httpd" set['apache']['log_dir'] = "/var/log/httpd" set['apache']['error_log'] = "error.log" set['apache']['user'] = "apache" set['apache']['group'] = "apache" set['apache']['binary'] = "/usr/sbin/httpd" set['apache']['icondir'] = "/var/www/icons" set['apache']['cache_dir'] = "/var/cache/httpd"
  • 31. Roles name "base" description "Base role for all servers" run_list( ! "recipe[apt]", ! "recipe[fail2ban]", ! "recipe[chef-client]" ) http://www.flickr.com/photos/ulteriorepicure/177506395/sizes/m/in/photostream/
  • 33. Basic Resources: package package "tar" do   version "1.16.1-1"   action :install end package "portmap" do action :remove end • Providers determine how to manage the packages on every platform
  • 34. Basic Resources: template • Templates are rendered when the Chef client runs on the node • Interprets the values of variables, search results, etc, to create dynamic configurations template "/tmp/config.conf" do   source "config.conf.erb"   variables(     :config_var => node[:configs][:config_var]   ) end
  • 35. Basic Resources: cookbook_file cookbook_file "/tmp/testfile" do   source "testfile" owner “root” group “root”   mode "0644" end
  • 36. Basic Resources: directory directory "/tmp/something" do   owner "root"   group "root"   mode "0755"   action :create end directory "C:tmpsomething.txt" do   rights :full_control, "DOMAINUser"   inherits false   action :create end
  • 37. Basic Resources: service service "apache2" do supports :restart => true action :enable end template "/etc/apache2/apache2.conf" do # ... other parameters notifies :restart, "service[apache2]" end
  • 38. Other Common Resources • User, Group • Cron • Execute: run arbitrary commands • File: files already on the node • Env (on Windows) • HTTP Request • Link
  • 41. Deciding on Cookbooks and Roles • Each service in your infrastructure usually has its own cookbook, or may have a collection of cookbooks in a role • A set of Tomcat servers may have a cookbook for java, a cookbook for Tomcat, and a cookbook for application code • The java and tomcat cookbooks can be reused in multiple applications • A common practice is to include a base role for universal configurations that should apply to all of your nodes • Security settings, DNS servers, local file repositories • Members of the Chef community share cookbooks at
  • 42. Environments • Environments allow you to think about not just groups of nodes running applications, but also the larger infrastructure • Every node belongs to only one environment • Environments can be used to specify which version of a cookbook to use on any node assigned to the environment • A common use of environments is assigning nodes to “dev”, “qa”, “staging”, and “production” • Each environment can be configured to use a different version of the available cookbooks • Attributes allow you to change settings based on the environment
  • 43. Reusability Dev Environment Node Name: devhost1 Environment: dev FQDN: devhost1.mydomain.com IP: 192.168.1.100 Run List: role[base], role[solr_master] Roles: base, solr_master Recipes: apt, fail2ban, chef-client, solr, solr::master Platform: ubuntu 10.04 Prod Environment Node Name: solr1 Environment: prod FQDN: solr1.mydomain.com IP: 192.168.10.50 Run List: role[base], role[solr_master] Roles: base, solr_master Recipes: apt, fail2ban, chef-client, solr, solr::master Platform: ubuntu 10.04
  • 44. Search • All node data is indexed on the Chef server • These indexes are available for searching from knife and recipes • Use search results to dynamically configure integrated resources search(:node, "role:webserver") do |match| puts match["ipaddress"] end
  • 46. Chef Code Workflow • You build recipes, cookbooks, roles, environments, etc as files in your local Chef repository • Check your code into source code control • Upload your infrastructure to the Chef server with knife • Nodes get their configuration information when they run chef-client • Nodes can run chef-client as often or as rarely as you need • You can test in a variety of ways that suit your infrastructure best
  • 47. Incorporating Version Control System • Employ the distributed version control system of your choice • Use what your team already knows! Chef doesn’t require a specific system • Git is popular, but SVN, Perforce, others are used as well • Decide on your testing, versioning, code review practices as suit your team’s needs
  • 49. How to Get Chef • Hosted Chef is a SaaS product hosted by Opscode • http://manage.opscode.com • You can create an account and add up to five nodes for free to try out chef • Our new installer makes installing Chef on nodes super easy! • http://www.opscode.com/chef/install • Provides a full stack, don’t worry about Ruby version issues
  • 50. More Info on Getting Started • Our wiki: http://wiki.opscode.com • Fast start guide: • http://wiki.opscode.com/display/chef/Fast+Start +Guide • Our Community site: http://community.opscode.com • Cookbooks in our Github account: http://github.com/ opscode/cookbooks • The materials for our 3-day Chef Fundamentals class are online: • https://github.com/opscode/chef-fundamentals
  • 51. Supported Platforms Ubuntu (10.04, 10.10, 11.04, 11.10) •Debian (5.0, 6.0) •RHEL & CentOS (5.x, 6.x) •Fedora 10+ •Mac OS X (10.4, 10.5, 10.6) •Windows 7 •Windows Server 2003 R2, 2008 R2
  • 52. Thanks, PICConf!! • mandi walls • mandi@opscode.com • @lnxchk
  • 53. Questions? • On freenode: #chef and #chef-hacking • http://lists.opscode.com • http://tickets.opscode.com • http://help.opscode.com • @opscode and @opscode_status on Twitter

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  21. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  22. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  23. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  24. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  25. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  26. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  27. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  28. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  29. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  30. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  31. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  32. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  33. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  34. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  35. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  36. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  37. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  38. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  39. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  40. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  41. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  42. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  43. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  44. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  45. Let's take a moment to discuss resources. This is the structure of a Chef resource.\n\n\n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n