SlideShare une entreprise Scribd logo
1  sur  51
Télécharger pour lire hors ligne
Chef Fundamentals
Chef Fundamentals
Chef Fundamentals Webinar Series - Module 6
Roles, Environments, Community Cookbooks, & Further Resources
training@opscode.com
Nathen Harvey
• Technical Community Manager at Opscode
• Co-host of the Food Fight Show Podcast
• @nathenharvey
• nharvey@opscode.com
Roles
Role-based Attributes and Merge Order Precedence
Lesson Objectives
• After completing the lesson, you will be able to
• Explain what Roles are, and how they are used to
provide clarity
• Manipulate a node's run_list using a Role
• Use attributes in a Role
• Show a Role with Knife
What is a Role?
• So far, we’ve been just adding recipes directly to a
single node
• But that’s not how your infrastructure works - think
about how you refer to servers
• "It’s a web server"
• "It’s a database server"
• "It’s a monitoring server"
What is a Role?
• Roles allow you to conveniently encapsulate the run
lists and attributes required for a server to "be" what
you already think it is
• In practice, Roles make it easy to configure many
nodes identically without repeating yourself each
time
Exercise: Create the webserver role
OPEN IN EDITOR: roles/webserver.rb

• A Role has a:
• name
• description
• run_list name

"webserver"
description "Web Server"
run_list "recipe[my-company]","recipe[apache]"
default_attributes({
"company" => "Opscode"
})
SAVE FILE!
Exercise: Create the role

Updated Role webserver!
Exercise: Create the role
$ knife role from file webserver.rb

Updated Role webserver!
When you combine merge
order and precedence
rules, you get this:
Merge Order and Precedence
Environments
Cookbook Version Constraints
Lesson Objectives
• After completing the lesson, you will be able to
• Describe what an Environment is, and how it is
different from an Organization
• Set cookbook version constraints
Environments
Development

Organization

Staging

Production
Environments
• Every Organization starts with a single environment
• Environments reflect your patterns and workflow
• Development
• Test
• Staging
• Production
• etc.
Environments Define Policy
• Each environment may include attributes necessary
for configuring the infrastructure in that environment
• Production needs certain Yum repos
• QA needs different Yum repos
• The version of the Chef cookbooks to be used
Environment Best Practice
• Best Practice: If you need to share cookbooks or
roles, you likely want an Environment rather than an
organization
• Environments allow for isolating resources within a
single organization
Using Community Cookbooks
Open Source: Saving you time!
Lesson Objectives
• After completing the lesson, you will be able to
• Use the Opscode Chef Community site to find,
preview and download cookbooks
• Use knife to work with the Community Site API
• Download, extract, examine and implement
cookbooks from the Community site
The easy way...
• We've been writing some cookbooks so far...
• Hundreds already exist for a large number of use
cases and purposes. Many (but only a fraction) are
maintained by Opscode.
• Think of it like RubyGems.org, CPAN.org, or other
focused plugin-style distribution sites.
Exercise: Find and preview cookbooks on the community site
Exercise: Find and preview cookbooks on the community site

Cookbooks!
Exercise: Search for a chef-client cookbook
Exercise: Search for a chef-client cookbook
Search for: chef-client
Search Results...
Search Results...

We’re probably looking
for this one
Viewing a cookbook
Viewing a cookbook

README displayed on the page
(if it has one)
Viewing a cookbook

Browse Source
Code

README displayed on the page
(if it has one)
You can download cookbooks directly from the site...

• You can download cookbooks directly from the
community site, but:
• It doesn't put them in your Chef Repository
• It isn't fast if you know what you're looking for (click,
click...)
• It isn't necessarily fast if you don't know what you're
looking for.
• You're already using knife for managing cookbooks
and other things in your Chef Repository.
Introducing Knife Cookbook Site plugin
• Knife includes a "cookbook site" plugin with some
sub-commands:
• search
• show
• download
• ... and more!
Download and use
chef-client cookbook
Exercise: Use knife to search the community site

chef:
cookbook:
cookbook_description:
cookbook_maintainer:
cookbook_name:
chef-client:
cookbook:
cookbook_description:
cookbook_maintainer:
cookbook_name:
chef-client-cron:
cookbook:
cookbook_description:
cookbook_maintainer:
cookbook_name:

http://cookbooks.opscode.com/api/v1/cookbooks/chef
Installs and configures Chef for chef-client and chef-server
opscode
chef
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client
Manages client.rb configuration and chef-client service
opscode
chef-client
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client-cron
Manages aspects of only chef-client
bryanwb
chef-client-cron
Exercise: Use knife to search the community site
$ knife cookbook site search chef-client
chef:
cookbook:
cookbook_description:
cookbook_maintainer:
cookbook_name:
chef-client:
cookbook:
cookbook_description:
cookbook_maintainer:
cookbook_name:
chef-client-cron:
cookbook:
cookbook_description:
cookbook_maintainer:
cookbook_name:

http://cookbooks.opscode.com/api/v1/cookbooks/chef
Installs and configures Chef for chef-client and chef-server
opscode
chef
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client
Manages client.rb configuration and chef-client service
opscode
chef-client
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client-cron
Manages aspects of only chef-client
bryanwb
chef-client-cron
Exercise: Use knife to show the chef-client cookbook on the
community site

average_rating: 4.85714
category:
Utilities
created_at:
2010-12-16T23:00:45Z
description:
Manages client.rb configuration and chef-client service
external_url:
github.com/opscode-cookbooks/chef-client
latest_version: http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/
3_1_0
maintainer:
opscode
name:
chef-client
updated_at:
2013-10-01T03:14:41Z
versions:
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_1_0
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_0_6
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_0_4
Exercise: Use knife to show the chef-client cookbook on the
community site

$ knife cookbook site show chef-client
average_rating: 4.85714
category:
Utilities
created_at:
2010-12-16T23:00:45Z
description:
Manages client.rb configuration and chef-client service
external_url:
github.com/opscode-cookbooks/chef-client
latest_version: http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/
3_1_0
maintainer:
opscode
name:
chef-client
updated_at:
2013-10-01T03:14:41Z
versions:
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_1_0
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_0_6
http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_0_4
Exercise: Download the chef-client cookbook

Downloading chef-client from the cookbooks
site at version 3.1.0 to /Users/YOU/chefrepo/chef-client-3.1.0.tar.gz
Cookbook saved: /Users/YOU/chef-repo/chefclient-3.1.0.tar.gz
Exercise: Download the chef-client cookbook
$ knife cookbook site download chef-client
Downloading chef-client from the cookbooks
site at version 3.1.0 to /Users/YOU/chefrepo/chef-client-3.1.0.tar.gz
Cookbook saved: /Users/YOU/chef-repo/chefclient-3.1.0.tar.gz
Exercise: Extract chef-client cookbook tarball

x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x

chef-client/
chef-client/attributes/
chef-client/CHANGELOG.md
chef-client/CONTRIBUTING
chef-client/LICENSE
chef-client/metadata.json
chef-client/metadata.rb
chef-client/README.md
chef-client/recipes/
chef-client/templates/
chef-client/templates/arch/
chef-client/templates/default/
chef-client/templates/windows/
chef-client/templates/default/debian/
chef-client/templates/default/redhat/
chef-client/templates/default/solaris/
chef-client/templates/arch/conf.d/
chef-client/templates/arch/rc.d/
chef-client/recipes/config.rb
chef-client/recipes/cron.rb
chef-client/recipes/default.rb
chef-client/recipes/delete_validation.rb
Exercise: Extract chef-client cookbook tarball
$ tar -zxvf chef-client*.tar.gz -C cookbooks/
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x

chef-client/
chef-client/attributes/
chef-client/CHANGELOG.md
chef-client/CONTRIBUTING
chef-client/LICENSE
chef-client/metadata.json
chef-client/metadata.rb
chef-client/README.md
chef-client/recipes/
chef-client/templates/
chef-client/templates/arch/
chef-client/templates/default/
chef-client/templates/windows/
chef-client/templates/default/debian/
chef-client/templates/default/redhat/
chef-client/templates/default/solaris/
chef-client/templates/arch/conf.d/
chef-client/templates/arch/rc.d/
chef-client/recipes/config.rb
chef-client/recipes/cron.rb
chef-client/recipes/default.rb
chef-client/recipes/delete_validation.rb
What we just did...
• Cookbooks are distributed as a versioned .tar.gz
archive.
• The latest version is downloaded by default (you can
specify the version).
• Extract the cookbook into the "cookbooks" directory
with tar.
• Next, let's examine the contents.
Best practice: well written cookbooks have a README!

• Documentation for cookbooks doesn't need to be
extensive, but a README should describe some
important aspects of a cookbook:
• Expectations (cookbooks, platform, data)
• Recipes and their purpose
• LWRPs, Libraries, etc.
• Usage notes
• Read the README first!
Best Practice: This runs as root!
• So, you just downloaded source code from the
internet.
• As root.
• To load in the magic machine that:
• Makes your computers run code
• Read the entire cookbook first!
Further Resources
There's more to Chef
• Data Bags
• Encrypted Data Bags
• LWRPs
• Report Handlers
• Knife plugins
• and more!
Further Resources: Cookbooks and Plugins
• Useful cookbooks
• DNS: djbdns, pdns, dnsimple,
dynect, route53
• Monitoring: nagios, munin,
zenoss, zabbix
• Package repos: yum, apt,
freebsd
• Security: ossec, snort,
cis_benchmark
• Logging: rsyslog, syslog-ng,
logstash, logwatch

• Application cookbooks:
• application, database
• python, java, php, ruby
• Plugins
• Cloud: knife-ec2, kniferackspace, knife-openstack,
knife-hp
• Windows: knife-windows
• More listed on docs.opscode.com
Further Resources
• http://opscode.com/
• http://community.opscode.com/
• http://docs.opscode.com/
• http://learnchef.com
• http://lists.opscode.com
• http://youtube.com/user/Opscode
• irc.freenode.net #chef, #chef-hacking, #learnchef
• Twitter #opschef
Food Fight Show
• http://foodfightshow.org
• The Podcast Where
DevOps Chef Do Battle
• Regular updates about
new Cookbooks, Knifeplugins, and more
• Best Practices for working
with Chef
Opscode #ChefConf 2014
• When:
• April 15-17, 2014
• Where:
• Hyatt Regency, San Francisco, CA
• Register:
• http://chefconf.opscode.com/chefconf
Nathen Harvey
• Technical Community Manager at Opscode
• Co-host of the Food Fight Show Podcast
• @nathenharvey
• nharvey@opscode.com

Contenu connexe

Tendances

Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to ChefKnoldus Inc.
 
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
 
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 Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeIntroduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeJosh Padnick
 
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
 
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
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with ChefRaimonds Simanovskis
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with ChefJennifer Davis
 
AWS Meetup - Sydney - February
AWS Meetup - Sydney - February AWS Meetup - Sydney - February
AWS Meetup - Sydney - February markghiasy
 
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
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Chef
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with ChefJonathan Weiss
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitJennifer Davis
 
Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local ModeMichael Goetz
 
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 Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesMamun Rashid, CCDH
 

Tendances (20)

Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
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
 
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 Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeIntroduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
 
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 )
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
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
 
Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
 
Opscode tech festa july 2013
Opscode tech festa   july 2013Opscode tech festa   july 2013
Opscode tech festa july 2013
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with Chef
 
AWS Meetup - Sydney - February
AWS Meetup - Sydney - February AWS Meetup - Sydney - February
AWS Meetup - Sydney - February
 
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
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local Mode
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Chef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS Newbies
 

En vedette

STIG Compliance and Remediation with Ansible
STIG Compliance and Remediation with AnsibleSTIG Compliance and Remediation with Ansible
STIG Compliance and Remediation with AnsibleAnsible
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Edureka!
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation WorkshopChef
 
Survey: Frozen Yogurt Market in India (2013)
Survey: Frozen Yogurt Market in India (2013)Survey: Frozen Yogurt Market in India (2013)
Survey: Frozen Yogurt Market in India (2013)Chef at Large
 
Chef Delivery
Chef DeliveryChef Delivery
Chef DeliveryChef
 
Puppet overview
Puppet overviewPuppet overview
Puppet overviewjoshbeard
 
Infrastructure Automation with Chef
Infrastructure Automation with Chef Infrastructure Automation with Chef
Infrastructure Automation with Chef REAN Cloud
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Alex S
 
Introduction to puppet
Introduction to puppetIntroduction to puppet
Introduction to puppetHabeeb Rahman
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricksbcoca
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
3 Steps to Expand DevOps and Automation Throughout the Enterprise
3 Steps to Expand DevOps and Automation Throughout the Enterprise3 Steps to Expand DevOps and Automation Throughout the Enterprise
3 Steps to Expand DevOps and Automation Throughout the EnterprisePuppet
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationJohn Lynch
 

En vedette (15)

Puppets
PuppetsPuppets
Puppets
 
STIG Compliance and Remediation with Ansible
STIG Compliance and Remediation with AnsibleSTIG Compliance and Remediation with Ansible
STIG Compliance and Remediation with Ansible
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation Workshop
 
Survey: Frozen Yogurt Market in India (2013)
Survey: Frozen Yogurt Market in India (2013)Survey: Frozen Yogurt Market in India (2013)
Survey: Frozen Yogurt Market in India (2013)
 
Chef Delivery
Chef DeliveryChef Delivery
Chef Delivery
 
Puppet overview
Puppet overviewPuppet overview
Puppet overview
 
Infrastructure Automation with Chef
Infrastructure Automation with Chef Infrastructure Automation with Chef
Infrastructure Automation with Chef
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Ansible
AnsibleAnsible
Ansible
 
Introduction to puppet
Introduction to puppetIntroduction to puppet
Introduction to puppet
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
3 Steps to Expand DevOps and Automation Throughout the Enterprise
3 Steps to Expand DevOps and Automation Throughout the Enterprise3 Steps to Expand DevOps and Automation Throughout the Enterprise
3 Steps to Expand DevOps and Automation Throughout the Enterprise
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 

Similaire à Chef Fundamentals Training Series Module 6: Roles, Environments, Community Cookbooks, and Other Resources

Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with ChefJohn Osborne
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetupSuresh Paulraj
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with ChefJoe Kepley
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with ChefBryan McLellan
 
Chef, Vagrant and Friends
Chef, Vagrant and FriendsChef, Vagrant and Friends
Chef, Vagrant and FriendsBen McRae
 
Emerging chef patterns and practices
Emerging chef patterns and practicesEmerging chef patterns and practices
Emerging chef patterns and practicesOwain Perry
 
Opscode Chef for Dummies
Opscode Chef for DummiesOpscode Chef for Dummies
Opscode Chef for Dummiesdilippanwar
 
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil DibowitzAtmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil DibowitzPROIDEA
 
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
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)Amazon Web Services
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott RusselKangaroot
 
Cook like a Chef
Cook like a ChefCook like a Chef
Cook like a ChefIan Yang
 
Introduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef AutomateIntroduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef AutomateAmazon Web Services
 
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
 
Compliance Automation with InSpec
Compliance Automation with InSpecCompliance Automation with InSpec
Compliance Automation with InSpec Nathen Harvey
 

Similaire à Chef Fundamentals Training Series Module 6: Roles, Environments, Community Cookbooks, and Other Resources (20)

Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetup
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with Chef
 
Chef Jumpstart
Chef JumpstartChef Jumpstart
Chef Jumpstart
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
 
AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef AutomateAWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate
 
Chef, Vagrant and Friends
Chef, Vagrant and FriendsChef, Vagrant and Friends
Chef, Vagrant and Friends
 
Emerging chef patterns and practices
Emerging chef patterns and practicesEmerging chef patterns and practices
Emerging chef patterns and practices
 
Opscode Chef for Dummies
Opscode Chef for DummiesOpscode Chef for Dummies
Opscode Chef for Dummies
 
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil DibowitzAtmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the Masses
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott Russel
 
Cook like a Chef
Cook like a ChefCook like a Chef
Cook like a Chef
 
Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
 
Introduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef AutomateIntroduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef Automate
 
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
 
Learning chef
Learning chefLearning chef
Learning chef
 
Compliance Automation with InSpec
Compliance Automation with InSpecCompliance Automation with InSpec
Compliance Automation with InSpec
 
Chef
ChefChef
Chef
 

Plus de Chef Software, Inc.

Opscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft WindowsOpscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft WindowsChef Software, Inc.
 
Opscode Webinar: Automation for Education May 08-2013
Opscode Webinar: Automation for Education May 08-2013Opscode Webinar: Automation for Education May 08-2013
Opscode Webinar: Automation for Education May 08-2013Chef Software, Inc.
 
Utility HPC: Right Systems, Right Scale, Right Science
Utility HPC: Right Systems, Right Scale, Right ScienceUtility HPC: Right Systems, Right Scale, Right Science
Utility HPC: Right Systems, Right Scale, Right ScienceChef Software, Inc.
 
Using Kanban and Chef: A Case Study – Jeffrey Hulten
Using Kanban and Chef: A Case Study – Jeffrey HultenUsing Kanban and Chef: A Case Study – Jeffrey Hulten
Using Kanban and Chef: A Case Study – Jeffrey HultenChef Software, Inc.
 
SDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
SDN, Network Virtualization and the Software Defined Data Center – Brad HedlundSDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
SDN, Network Virtualization and the Software Defined Data Center – Brad HedlundChef Software, Inc.
 
ChefConf 2013 Keynote Session – Opscode – Adam Jacob
ChefConf 2013 Keynote Session – Opscode – Adam JacobChefConf 2013 Keynote Session – Opscode – Adam Jacob
ChefConf 2013 Keynote Session – Opscode – Adam JacobChef Software, Inc.
 
Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...
Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...
Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...Chef Software, Inc.
 
The InstallShield of the 21st Century – Theo Schlossnagle
The InstallShield of the 21st Century – Theo SchlossnagleThe InstallShield of the 21st Century – Theo Schlossnagle
The InstallShield of the 21st Century – Theo SchlossnagleChef Software, Inc.
 
Chef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK BoxChef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK BoxChef Software, Inc.
 
Push jobs: an orchestration building block for private Chef
Push jobs: an orchestration building block for private ChefPush jobs: an orchestration building block for private Chef
Push jobs: an orchestration building block for private ChefChef Software, Inc.
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreChef Software, Inc.
 
Welcome to the IT Industrial Revolution! Are you ready?
Welcome to the IT Industrial Revolution! Are you ready?Welcome to the IT Industrial Revolution! Are you ready?
Welcome to the IT Industrial Revolution! Are you ready?Chef Software, Inc.
 
Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...
Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...
Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...Chef Software, Inc.
 
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.
 
Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)Chef Software, Inc.
 
Creating a culture for Continuous Delivery
Creating a culture for Continuous DeliveryCreating a culture for Continuous Delivery
Creating a culture for Continuous DeliveryChef Software, Inc.
 
Cookin’ up Hybrid Clouds: Chef and the Accenture Cloud Platform
Cookin’ up Hybrid Clouds: Chef and the Accenture Cloud PlatformCookin’ up Hybrid Clouds: Chef and the Accenture Cloud Platform
Cookin’ up Hybrid Clouds: Chef and the Accenture Cloud PlatformChef Software, Inc.
 
Exploiting Conway’s Law for Underpants and Profit
 Exploiting Conway’s Law for Underpants and Profit Exploiting Conway’s Law for Underpants and Profit
Exploiting Conway’s Law for Underpants and ProfitChef Software, Inc.
 
Configuration management and #monitoringlove
Configuration management and #monitoringloveConfiguration management and #monitoringlove
Configuration management and #monitoringloveChef Software, Inc.
 

Plus de Chef Software, Inc. (20)

Opscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft WindowsOpscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft Windows
 
Opscode Webinar: Automation for Education May 08-2013
Opscode Webinar: Automation for Education May 08-2013Opscode Webinar: Automation for Education May 08-2013
Opscode Webinar: Automation for Education May 08-2013
 
Utility HPC: Right Systems, Right Scale, Right Science
Utility HPC: Right Systems, Right Scale, Right ScienceUtility HPC: Right Systems, Right Scale, Right Science
Utility HPC: Right Systems, Right Scale, Right Science
 
The Berkshelf Way
The Berkshelf WayThe Berkshelf Way
The Berkshelf Way
 
Using Kanban and Chef: A Case Study – Jeffrey Hulten
Using Kanban and Chef: A Case Study – Jeffrey HultenUsing Kanban and Chef: A Case Study – Jeffrey Hulten
Using Kanban and Chef: A Case Study – Jeffrey Hulten
 
SDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
SDN, Network Virtualization and the Software Defined Data Center – Brad HedlundSDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
SDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
 
ChefConf 2013 Keynote Session – Opscode – Adam Jacob
ChefConf 2013 Keynote Session – Opscode – Adam JacobChefConf 2013 Keynote Session – Opscode – Adam Jacob
ChefConf 2013 Keynote Session – Opscode – Adam Jacob
 
Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...
Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...
Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...
 
The InstallShield of the 21st Century – Theo Schlossnagle
The InstallShield of the 21st Century – Theo SchlossnagleThe InstallShield of the 21st Century – Theo Schlossnagle
The InstallShield of the 21st Century – Theo Schlossnagle
 
Chef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK BoxChef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK Box
 
Push jobs: an orchestration building block for private Chef
Push jobs: an orchestration building block for private ChefPush jobs: an orchestration building block for private Chef
Push jobs: an orchestration building block for private Chef
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and more
 
Welcome to the IT Industrial Revolution! Are you ready?
Welcome to the IT Industrial Revolution! Are you ready?Welcome to the IT Industrial Revolution! Are you ready?
Welcome to the IT Industrial Revolution! Are you ready?
 
Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...
Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...
Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...
 
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
 
Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)
 
Creating a culture for Continuous Delivery
Creating a culture for Continuous DeliveryCreating a culture for Continuous Delivery
Creating a culture for Continuous Delivery
 
Cookin’ up Hybrid Clouds: Chef and the Accenture Cloud Platform
Cookin’ up Hybrid Clouds: Chef and the Accenture Cloud PlatformCookin’ up Hybrid Clouds: Chef and the Accenture Cloud Platform
Cookin’ up Hybrid Clouds: Chef and the Accenture Cloud Platform
 
Exploiting Conway’s Law for Underpants and Profit
 Exploiting Conway’s Law for Underpants and Profit Exploiting Conway’s Law for Underpants and Profit
Exploiting Conway’s Law for Underpants and Profit
 
Configuration management and #monitoringlove
Configuration management and #monitoringloveConfiguration management and #monitoringlove
Configuration management and #monitoringlove
 

Dernier

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Dernier (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Chef Fundamentals Training Series Module 6: Roles, Environments, Community Cookbooks, and Other Resources

  • 2. Chef Fundamentals Chef Fundamentals Webinar Series - Module 6 Roles, Environments, Community Cookbooks, & Further Resources training@opscode.com
  • 3. Nathen Harvey • Technical Community Manager at Opscode • Co-host of the Food Fight Show Podcast • @nathenharvey • nharvey@opscode.com
  • 4. Roles Role-based Attributes and Merge Order Precedence
  • 5. Lesson Objectives • After completing the lesson, you will be able to • Explain what Roles are, and how they are used to provide clarity • Manipulate a node's run_list using a Role • Use attributes in a Role • Show a Role with Knife
  • 6. What is a Role? • So far, we’ve been just adding recipes directly to a single node • But that’s not how your infrastructure works - think about how you refer to servers • "It’s a web server" • "It’s a database server" • "It’s a monitoring server"
  • 7. What is a Role? • Roles allow you to conveniently encapsulate the run lists and attributes required for a server to "be" what you already think it is • In practice, Roles make it easy to configure many nodes identically without repeating yourself each time
  • 8. Exercise: Create the webserver role OPEN IN EDITOR: roles/webserver.rb • A Role has a: • name • description • run_list name "webserver" description "Web Server" run_list "recipe[my-company]","recipe[apache]" default_attributes({ "company" => "Opscode" }) SAVE FILE!
  • 9. Exercise: Create the role Updated Role webserver!
  • 10. Exercise: Create the role $ knife role from file webserver.rb Updated Role webserver!
  • 11. When you combine merge order and precedence rules, you get this:
  • 12. Merge Order and Precedence
  • 14. Lesson Objectives • After completing the lesson, you will be able to • Describe what an Environment is, and how it is different from an Organization • Set cookbook version constraints
  • 16. Environments • Every Organization starts with a single environment • Environments reflect your patterns and workflow • Development • Test • Staging • Production • etc.
  • 17. Environments Define Policy • Each environment may include attributes necessary for configuring the infrastructure in that environment • Production needs certain Yum repos • QA needs different Yum repos • The version of the Chef cookbooks to be used
  • 18. Environment Best Practice • Best Practice: If you need to share cookbooks or roles, you likely want an Environment rather than an organization • Environments allow for isolating resources within a single organization
  • 19. Using Community Cookbooks Open Source: Saving you time!
  • 20. Lesson Objectives • After completing the lesson, you will be able to • Use the Opscode Chef Community site to find, preview and download cookbooks • Use knife to work with the Community Site API • Download, extract, examine and implement cookbooks from the Community site
  • 21. The easy way... • We've been writing some cookbooks so far... • Hundreds already exist for a large number of use cases and purposes. Many (but only a fraction) are maintained by Opscode. • Think of it like RubyGems.org, CPAN.org, or other focused plugin-style distribution sites.
  • 22. Exercise: Find and preview cookbooks on the community site
  • 23. Exercise: Find and preview cookbooks on the community site Cookbooks!
  • 24. Exercise: Search for a chef-client cookbook
  • 25. Exercise: Search for a chef-client cookbook Search for: chef-client
  • 27. Search Results... We’re probably looking for this one
  • 29. Viewing a cookbook README displayed on the page (if it has one)
  • 30. Viewing a cookbook Browse Source Code README displayed on the page (if it has one)
  • 31. You can download cookbooks directly from the site... • You can download cookbooks directly from the community site, but: • It doesn't put them in your Chef Repository • It isn't fast if you know what you're looking for (click, click...) • It isn't necessarily fast if you don't know what you're looking for. • You're already using knife for managing cookbooks and other things in your Chef Repository.
  • 32. Introducing Knife Cookbook Site plugin • Knife includes a "cookbook site" plugin with some sub-commands: • search • show • download • ... and more!
  • 34. Exercise: Use knife to search the community site chef: cookbook: cookbook_description: cookbook_maintainer: cookbook_name: chef-client: cookbook: cookbook_description: cookbook_maintainer: cookbook_name: chef-client-cron: cookbook: cookbook_description: cookbook_maintainer: cookbook_name: http://cookbooks.opscode.com/api/v1/cookbooks/chef Installs and configures Chef for chef-client and chef-server opscode chef http://cookbooks.opscode.com/api/v1/cookbooks/chef-client Manages client.rb configuration and chef-client service opscode chef-client http://cookbooks.opscode.com/api/v1/cookbooks/chef-client-cron Manages aspects of only chef-client bryanwb chef-client-cron
  • 35. Exercise: Use knife to search the community site $ knife cookbook site search chef-client chef: cookbook: cookbook_description: cookbook_maintainer: cookbook_name: chef-client: cookbook: cookbook_description: cookbook_maintainer: cookbook_name: chef-client-cron: cookbook: cookbook_description: cookbook_maintainer: cookbook_name: http://cookbooks.opscode.com/api/v1/cookbooks/chef Installs and configures Chef for chef-client and chef-server opscode chef http://cookbooks.opscode.com/api/v1/cookbooks/chef-client Manages client.rb configuration and chef-client service opscode chef-client http://cookbooks.opscode.com/api/v1/cookbooks/chef-client-cron Manages aspects of only chef-client bryanwb chef-client-cron
  • 36. Exercise: Use knife to show the chef-client cookbook on the community site average_rating: 4.85714 category: Utilities created_at: 2010-12-16T23:00:45Z description: Manages client.rb configuration and chef-client service external_url: github.com/opscode-cookbooks/chef-client latest_version: http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/ 3_1_0 maintainer: opscode name: chef-client updated_at: 2013-10-01T03:14:41Z versions: http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_1_0 http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_0_6 http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_0_4
  • 37. Exercise: Use knife to show the chef-client cookbook on the community site $ knife cookbook site show chef-client average_rating: 4.85714 category: Utilities created_at: 2010-12-16T23:00:45Z description: Manages client.rb configuration and chef-client service external_url: github.com/opscode-cookbooks/chef-client latest_version: http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/ 3_1_0 maintainer: opscode name: chef-client updated_at: 2013-10-01T03:14:41Z versions: http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_1_0 http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_0_6 http://cookbooks.opscode.com/api/v1/cookbooks/chef-client/versions/3_0_4
  • 38. Exercise: Download the chef-client cookbook Downloading chef-client from the cookbooks site at version 3.1.0 to /Users/YOU/chefrepo/chef-client-3.1.0.tar.gz Cookbook saved: /Users/YOU/chef-repo/chefclient-3.1.0.tar.gz
  • 39. Exercise: Download the chef-client cookbook $ knife cookbook site download chef-client Downloading chef-client from the cookbooks site at version 3.1.0 to /Users/YOU/chefrepo/chef-client-3.1.0.tar.gz Cookbook saved: /Users/YOU/chef-repo/chefclient-3.1.0.tar.gz
  • 40. Exercise: Extract chef-client cookbook tarball x x x x x x x x x x x x x x x x x x x x x x chef-client/ chef-client/attributes/ chef-client/CHANGELOG.md chef-client/CONTRIBUTING chef-client/LICENSE chef-client/metadata.json chef-client/metadata.rb chef-client/README.md chef-client/recipes/ chef-client/templates/ chef-client/templates/arch/ chef-client/templates/default/ chef-client/templates/windows/ chef-client/templates/default/debian/ chef-client/templates/default/redhat/ chef-client/templates/default/solaris/ chef-client/templates/arch/conf.d/ chef-client/templates/arch/rc.d/ chef-client/recipes/config.rb chef-client/recipes/cron.rb chef-client/recipes/default.rb chef-client/recipes/delete_validation.rb
  • 41. Exercise: Extract chef-client cookbook tarball $ tar -zxvf chef-client*.tar.gz -C cookbooks/ x x x x x x x x x x x x x x x x x x x x x x chef-client/ chef-client/attributes/ chef-client/CHANGELOG.md chef-client/CONTRIBUTING chef-client/LICENSE chef-client/metadata.json chef-client/metadata.rb chef-client/README.md chef-client/recipes/ chef-client/templates/ chef-client/templates/arch/ chef-client/templates/default/ chef-client/templates/windows/ chef-client/templates/default/debian/ chef-client/templates/default/redhat/ chef-client/templates/default/solaris/ chef-client/templates/arch/conf.d/ chef-client/templates/arch/rc.d/ chef-client/recipes/config.rb chef-client/recipes/cron.rb chef-client/recipes/default.rb chef-client/recipes/delete_validation.rb
  • 42. What we just did... • Cookbooks are distributed as a versioned .tar.gz archive. • The latest version is downloaded by default (you can specify the version). • Extract the cookbook into the "cookbooks" directory with tar. • Next, let's examine the contents.
  • 43. Best practice: well written cookbooks have a README! • Documentation for cookbooks doesn't need to be extensive, but a README should describe some important aspects of a cookbook: • Expectations (cookbooks, platform, data) • Recipes and their purpose • LWRPs, Libraries, etc. • Usage notes • Read the README first!
  • 44. Best Practice: This runs as root! • So, you just downloaded source code from the internet. • As root. • To load in the magic machine that: • Makes your computers run code • Read the entire cookbook first!
  • 46. There's more to Chef • Data Bags • Encrypted Data Bags • LWRPs • Report Handlers • Knife plugins • and more!
  • 47. Further Resources: Cookbooks and Plugins • Useful cookbooks • DNS: djbdns, pdns, dnsimple, dynect, route53 • Monitoring: nagios, munin, zenoss, zabbix • Package repos: yum, apt, freebsd • Security: ossec, snort, cis_benchmark • Logging: rsyslog, syslog-ng, logstash, logwatch • Application cookbooks: • application, database • python, java, php, ruby • Plugins • Cloud: knife-ec2, kniferackspace, knife-openstack, knife-hp • Windows: knife-windows • More listed on docs.opscode.com
  • 48. Further Resources • http://opscode.com/ • http://community.opscode.com/ • http://docs.opscode.com/ • http://learnchef.com • http://lists.opscode.com • http://youtube.com/user/Opscode • irc.freenode.net #chef, #chef-hacking, #learnchef • Twitter #opschef
  • 49. Food Fight Show • http://foodfightshow.org • The Podcast Where DevOps Chef Do Battle • Regular updates about new Cookbooks, Knifeplugins, and more • Best Practices for working with Chef
  • 50. Opscode #ChefConf 2014 • When: • April 15-17, 2014 • Where: • Hyatt Regency, San Francisco, CA • Register: • http://chefconf.opscode.com/chefconf
  • 51. Nathen Harvey • Technical Community Manager at Opscode • Co-host of the Food Fight Show Podcast • @nathenharvey • nharvey@opscode.com