SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Chef Fundamentals
training@getchef.com
Copyright (C) 2014 Chef Software, Inc.
Nathen Harvey
• Community Director
• Co-host of the Food Fight Show Podcast
!
• @nathenharvey
Questions & Answers
• Ask questions in the chat
window when they come to
you
• We’ll answer as many
questions as we can at the
end of the session
Questions & Answers
• Ask questions in the
Google Discussion Forum
!
• This can be used during
the webinar and outside
of the webinar, too.
!
• https://groups.google.com/d/
forum/learnchef-fundamentals-
webinar
Slides and Video
• This webinar is being recorded. The video will be
made available shortly after the session has ended.
!
• The slides used throughout this webinar will be
made available at the end of each webinar.
!
• Watch http://learnchef.com for updates.
Topics
• Overview of Chef
• Workstation Setup
• Node Setup
• Chef Resources and Recipes
• Working with the Node object
• Roles
• Common configuration with Data Bags
• Environments
• Community Cookbooks and Further Resources
Quick Recap
Where are we?
7
In the last module
• Refactored our apache cookbook to include multiple
sites
8
Where did my Node go?
• We still need a CentOS machine to manage
• The one we launched last time has likely expired
• Launch a new one using the Chef Lab
• Hopefully, you’ve already done this. We’re not
going to spend time walking through it now.
9
Launch Chef Training Lab
10
$ ssh root@<EXTERNAL_ADDRESS>
Lab - Login
The authenticity of host 'uvo1qrwls0jdgs3blvt.vm.cld.sr
(69.195.232.110)' can't be established.!
RSA key fingerprint is d9:95:a3:b9:02:27:e9:cd:
74:e4:a2:34:23:f5:a6:8b.!
Are you sure you want to continue connecting (yes/no)? yes!
Warning: Permanently added 'uvo1qrwls0jdgs3blvt.vm.cld.sr,
69.195.232.110' (RSA) to the list of known hosts.!
chef@uvo1qrwls0jdgs3blvt.vm.cld.sr's password: !
Last login: Mon Jan 6 16:26:24 2014 from
host86-145-117-53.range86-145.btcentralplus.com!
[chef@CentOS63 ~]$
11
$ knife bootstrap <EXTERNAL_ADDRESS> -x root -P chef -N ‘module5’ -r ‘role[webserver]’
"Bootstrap" the Target Instance
Bootstrapping Chef on uvo1qrwls0jdgs3blvt.vm.cld.sr!
...!
...!
uvo1qrwls0jdgs3blvt.vm.cld.sr Creating a new client identity for
module3 using the validator key.!
uvo1qrwls0jdgs3blvt.vm.cld.sr resolving cookbooks for run list: []!
uvo1qrwls0jdgs3blvt.vm.cld.sr Synchronizing Cookbooks:!
uvo1qrwls0jdgs3blvt.vm.cld.sr Compiling Cookbooks...!
uvo1qrwls0jdgs3blvt.vm.cld.sr [2014-01-28T11:03:14-05:00] WARN: Node
module3 has an empty run list.!
uvo1qrwls0jdgs3blvt.vm.cld.sr Converging 0 resources!
uvo1qrwls0jdgs3blvt.vm.cld.sr Chef Client finished, 0 resources updated
12
Exercise: Verify that the home page works
• Open a web browser
• Type in the the URL for your test node
13
v2.1.0
Environments
Cookbook Version Constraints and Override Attributes
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
• Explain when to set attributes in an environment
15
Organization
Environments
Development Staging Production
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
• We cannot share cookbooks between organizations
• 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
$ knife cookbook show apache
Exercise: Use knife to show the available cookbook versions
apache 0.2.0 0.1.0
20
Exercise: List current environments
_default
• The _default environment is read-only, and sets
no policy at all
21
$ knife environment list
Exercise: List current environments
_default
• The _default environment is read-only, and sets
no policy at all
21
$ mkdir environments
Make an environments directory
(No output)
22
OPEN IN EDITOR:
SAVE FILE!
environments/dev.rb
name "dev"!
description "For developers!"!
cookbook "apache", "= 0.2.0"
Exercise: Create a dev environment
• Environments have names
• Environments have a description
• Environments can have one or more cookbook constraints
23
• = Equal to
• There are other options but equality is the
recommended practice.
• Learn more at http://docs.opscode.com/chef/
essentials_cookbook_versions.html
Cookbook Version Constraints
24
Exercise: Create the dev environment
Updated Environment dev
25
$ knife environment from file dev.rb
Exercise: Create the dev environment
Updated Environment dev
25
Exercise: Show your dev environment
chef_type: environment!
cookbook_versions: !
apache: = 0.2.0!
default_attributes: !
description: For developers!!
json_class: Chef::Environment!
name: dev!
override_attributes:
26
$ knife environment show dev
Exercise: Show your dev environment
chef_type: environment!
cookbook_versions: !
apache: = 0.2.0!
default_attributes: !
description: For developers!!
json_class: Chef::Environment!
name: dev!
override_attributes:
26
Exercise: Change your node’s environment to "dev"
• Click the ‘Nodes’ tab then select node ‘module5’
• Select dev from the ‘Environments’ drop-down list
• Click ‘Save’
27
Exercise: Re-run the Chef Client
INFO: Chef Run complete in 1.587776095 seconds!
INFO: Running report handlers!
INFO: Report handlers complete
28
chef@module5$ sudo chef-client
Exercise: Re-run the Chef Client
INFO: Chef Run complete in 1.587776095 seconds!
INFO: Running report handlers!
INFO: Report handlers complete
28
name "production"!
description "For Production!"!
cookbook "apache", "= 0.1.0"!
OPEN IN EDITOR: environments/production.rb
SAVE FILE!
Exercise: Create a production environment
• Make sure the apache
cookbook is set to
version 0.1.0
29
Exercise: Create the production environment
Updated Environment production
30
$ knife environment from file production.rb
Exercise: Create the production environment
Updated Environment production
30
Exercise: Change your node’s environment to "production"
• Click the ‘Nodes’ tab then select node ‘module5’
• Select production from the ‘Environments’ drop-down list
• Click ‘Save’
31
Exercise: Re-run the Chef Client
INFO: Loading cookbooks [apache, motd, pci, users]!
Synchronizing Cookbooks:!
...!
Recipe: motd::default!
* template[/etc/motd] action create[2014-01-07T08:40:00-05:00] INFO: Processing template[/etc/motd] action create
(motd::default line 9)!
[2014-01-07T08:40:00-05:00] INFO: template[/etc/motd] backed up to /var/chef/backup/etc/motd.chef-20140107084000.070961!
[2014-01-07T08:40:00-05:00] INFO: template[/etc/motd] updated file contents /etc/motd!
!
- update content in file /etc/motd from d36e1f to 62ebb9!
(current file is binary, diff output suppressed)!
...!
* cookbook_file[/var/www/index.html] action create[2014-01-07T08:40:05-05:00] INFO: Processing cookbook_file[/var/
www/index.html] action create (apache::default line 18)!
(up to date)!
[2014-01-07T08:40:06-05:00] INFO: Chef Run complete in 8.048307322 seconds!
[2014-01-07T08:40:06-05:00] INFO: Removing cookbooks/apache/templates/default/index.html.erb from the cache; it is no
longer needed by chef-client.!
[2014-01-07T08:40:06-05:00] INFO: Removing cookbooks/apache/templates/default/custom.erb from the cache; it is no
longer needed by chef-client.
32
chef@module5$ sudo chef-client
Exercise: Re-run the Chef Client
INFO: Loading cookbooks [apache, motd, pci, users]!
Synchronizing Cookbooks:!
...!
Recipe: motd::default!
* template[/etc/motd] action create[2014-01-07T08:40:00-05:00] INFO: Processing template[/etc/motd] action create
(motd::default line 9)!
[2014-01-07T08:40:00-05:00] INFO: template[/etc/motd] backed up to /var/chef/backup/etc/motd.chef-20140107084000.070961!
[2014-01-07T08:40:00-05:00] INFO: template[/etc/motd] updated file contents /etc/motd!
!
- update content in file /etc/motd from d36e1f to 62ebb9!
(current file is binary, diff output suppressed)!
...!
* cookbook_file[/var/www/index.html] action create[2014-01-07T08:40:05-05:00] INFO: Processing cookbook_file[/var/
www/index.html] action create (apache::default line 18)!
(up to date)!
[2014-01-07T08:40:06-05:00] INFO: Chef Run complete in 8.048307322 seconds!
[2014-01-07T08:40:06-05:00] INFO: Removing cookbooks/apache/templates/default/index.html.erb from the cache; it is no
longer needed by chef-client.!
[2014-01-07T08:40:06-05:00] INFO: Removing cookbooks/apache/templates/default/custom.erb from the cache; it is no
longer needed by chef-client.
32
• Chef is not magic - it manages state for declared
resources
• We just rolled back to an earlier version of the apache
cookbook
• While the recipe applied fine, investigating the system
will reveal Apache is still configured as it was in the
0.2.0 cookbook
Rollbacks and Desired State Best Practice
33
Chef Fundamentals
Webinar Series
Six Week Series
• Module 1 - Overview of Chef
• Module 2 - Node Setup, Chef Resources & Recipes
• Module 3 - Working with the Node object & Roles
• June 10 - Common configuration data with Databags
• Today - Environments
• June 24 - Community Cookbooks and Further Resources
!
!
• * Topics subject to change, schedule unlikely to change
Sign-up for Webinar
• http://pages.getchef.com/
cheffundamentalsseries.html
Additional Resources
• Chef Fundamentals Webinar Series
• https://www.youtube.com/watch?
v=S5lHUpzoCYo&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbum
Z
!
• Discussion group for webinar participants
• https://groups.google.com/d/forum/learnchef-fundamentals-webinar
37
Additional Resources
• Learn Chef
• http://learnchef.com
!
• Documentation
• http://docs.opscode.com
38

Weitere ähnliche Inhalte

Was ist angesagt?

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.
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Software, Inc.
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to ChefKnoldus Inc.
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with ChefJennifer Davis
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitJennifer Davis
 
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, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and YouBryan Berry
 
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
 
Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local ModeMichael Goetz
 
Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with ChefJohn Ewart
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation WorkshopChef
 
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
 
Orchestration with Chef
Orchestration with ChefOrchestration with Chef
Orchestration with ChefMayank Gaikwad
 
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!
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with ChefRaimonds Simanovskis
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshopjtimberman
 

Was ist angesagt? (20)

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
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with Chef
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 
Chef, Devops, and You
Chef, Devops, and YouChef, Devops, and You
Chef, Devops, and You
 
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
 
Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local Mode
 
Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
 
Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation Workshop
 
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
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Orchestration with Chef
Orchestration with ChefOrchestration with Chef
Orchestration with Chef
 
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...
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
 

Andere mochten auch

Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with ChefAdam Jacob
 
Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an IntroductionSanjeev Sharma
 
Jenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentJenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentDan Stine
 
Chef for beginners module 2
Chef for beginners   module 2Chef for beginners   module 2
Chef for beginners module 2Chef
 
Chef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationChef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationJulian Dunn
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...Sonatype
 

Andere mochten auch (6)

Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an Introduction
 
Jenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentJenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated Deployment
 
Chef for beginners module 2
Chef for beginners   module 2Chef for beginners   module 2
Chef for beginners module 2
 
Chef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationChef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous Integration
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
 

Ähnlich wie Environments - Fundamentals Webinar Series Week 5

Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012Patrick McDonnell
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlabChef
 
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
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerMandi Walls
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with ChefJoe Kepley
 
What Makes a Good Cookbook?
What Makes a Good Cookbook?What Makes a Good Cookbook?
What Makes a Good Cookbook?Julian Dunn
 
Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Mischa Taylor
 
Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2Sylvain Tissot
 
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
 
Open Source Recipes for Chef Deployments of Hadoop
Open Source Recipes for Chef Deployments of HadoopOpen Source Recipes for Chef Deployments of Hadoop
Open Source Recipes for Chef Deployments of HadoopDataWorks Summit
 
Chef - Administration for programmers
Chef - Administration for programmersChef - Administration for programmers
Chef - Administration for programmersmrsabo
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott RusselKangaroot
 
Emerging chef patterns and practices
Emerging chef patterns and practicesEmerging chef patterns and practices
Emerging chef patterns and practicesOwain Perry
 
Chef for beginners module 4
Chef for beginners   module 4Chef for beginners   module 4
Chef for beginners module 4Chef
 
Building a PaaS using Chef
Building a PaaS using ChefBuilding a PaaS using Chef
Building a PaaS using ChefShaun Domingo
 

Ähnlich wie Environments - Fundamentals Webinar Series Week 5 (20)

Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012
 
Chef Jumpstart
Chef JumpstartChef Jumpstart
Chef Jumpstart
 
The Environment Restaurant
The Environment RestaurantThe Environment Restaurant
The Environment Restaurant
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlab
 
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
 
AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef AutomateAWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and Docker
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with Chef
 
What Makes a Good Cookbook?
What Makes a Good Cookbook?What Makes a Good Cookbook?
What Makes a Good Cookbook?
 
Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
 
Chef training Day4
Chef training Day4Chef training Day4
Chef training Day4
 
Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)
 
Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2Testing your-automation-code (vagrant version) v0.2
Testing your-automation-code (vagrant version) v0.2
 
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)
 
Open Source Recipes for Chef Deployments of Hadoop
Open Source Recipes for Chef Deployments of HadoopOpen Source Recipes for Chef Deployments of Hadoop
Open Source Recipes for Chef Deployments of Hadoop
 
Chef - Administration for programmers
Chef - Administration for programmersChef - Administration for programmers
Chef - Administration for programmers
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott Russel
 
Emerging chef patterns and practices
Emerging chef patterns and practicesEmerging chef patterns and practices
Emerging chef patterns and practices
 
Chef for beginners module 4
Chef for beginners   module 4Chef for beginners   module 4
Chef for beginners module 4
 
Building a PaaS using Chef
Building a PaaS using ChefBuilding a PaaS using Chef
Building a PaaS using Chef
 

Mehr von Chef

Habitat Managed Chef
Habitat Managed ChefHabitat Managed Chef
Habitat Managed ChefChef
 
Automation, Audits, and Apps Tour
Automation, Audits, and Apps TourAutomation, Audits, and Apps Tour
Automation, Audits, and Apps TourChef
 
Automation, Audits, and Apps Tour
Automation, Audits, and Apps TourAutomation, Audits, and Apps Tour
Automation, Audits, and Apps TourChef
 
London Community Summit 2016 - Adopting Chef Compliance
London Community Summit 2016 - Adopting Chef ComplianceLondon Community Summit 2016 - Adopting Chef Compliance
London Community Summit 2016 - Adopting Chef ComplianceChef
 
Learning from Configuration Management
Learning from Configuration Management Learning from Configuration Management
Learning from Configuration Management Chef
 
London Community Summit 2016 - Fresh New Chef Stuff
London Community Summit 2016 - Fresh New Chef StuffLondon Community Summit 2016 - Fresh New Chef Stuff
London Community Summit 2016 - Fresh New Chef StuffChef
 
London Community Summit - Chef at SkyBet
London Community Summit - Chef at SkyBetLondon Community Summit - Chef at SkyBet
London Community Summit - Chef at SkyBetChef
 
London Community Summit - From Contribution to Authorship
London Community Summit - From Contribution to AuthorshipLondon Community Summit - From Contribution to Authorship
London Community Summit - From Contribution to AuthorshipChef
 
London Community Summit 2016 - Chef Automate
London Community Summit 2016 - Chef AutomateLondon Community Summit 2016 - Chef Automate
London Community Summit 2016 - Chef AutomateChef
 
London Community Summit 2016 - Community Update
London Community Summit 2016 - Community UpdateLondon Community Summit 2016 - Community Update
London Community Summit 2016 - Community UpdateChef
 
London Community Summit 2016 - Habitat
London Community Summit 2016 -  HabitatLondon Community Summit 2016 -  Habitat
London Community Summit 2016 - HabitatChef
 
Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4Chef
 
Compliance Automation with Inspec Part 3
Compliance Automation with Inspec Part 3Compliance Automation with Inspec Part 3
Compliance Automation with Inspec Part 3Chef
 
Compliance Automation with Inspec Part 2
Compliance Automation with Inspec Part 2Compliance Automation with Inspec Part 2
Compliance Automation with Inspec Part 2Chef
 
Compliance Automation with Inspec Part 1
Compliance Automation with Inspec Part 1Compliance Automation with Inspec Part 1
Compliance Automation with Inspec Part 1Chef
 
Application Automation with Habitat
Application Automation with HabitatApplication Automation with Habitat
Application Automation with HabitatChef
 
Achieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef AutomateAchieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef AutomateChef
 
Nike pop up habitat
Nike pop up   habitatNike pop up   habitat
Nike pop up habitatChef
 
Nike popup compliance workshop
Nike popup compliance workshopNike popup compliance workshop
Nike popup compliance workshopChef
 
Chef Automate Workflow Demo
Chef Automate Workflow DemoChef Automate Workflow Demo
Chef Automate Workflow DemoChef
 

Mehr von Chef (20)

Habitat Managed Chef
Habitat Managed ChefHabitat Managed Chef
Habitat Managed Chef
 
Automation, Audits, and Apps Tour
Automation, Audits, and Apps TourAutomation, Audits, and Apps Tour
Automation, Audits, and Apps Tour
 
Automation, Audits, and Apps Tour
Automation, Audits, and Apps TourAutomation, Audits, and Apps Tour
Automation, Audits, and Apps Tour
 
London Community Summit 2016 - Adopting Chef Compliance
London Community Summit 2016 - Adopting Chef ComplianceLondon Community Summit 2016 - Adopting Chef Compliance
London Community Summit 2016 - Adopting Chef Compliance
 
Learning from Configuration Management
Learning from Configuration Management Learning from Configuration Management
Learning from Configuration Management
 
London Community Summit 2016 - Fresh New Chef Stuff
London Community Summit 2016 - Fresh New Chef StuffLondon Community Summit 2016 - Fresh New Chef Stuff
London Community Summit 2016 - Fresh New Chef Stuff
 
London Community Summit - Chef at SkyBet
London Community Summit - Chef at SkyBetLondon Community Summit - Chef at SkyBet
London Community Summit - Chef at SkyBet
 
London Community Summit - From Contribution to Authorship
London Community Summit - From Contribution to AuthorshipLondon Community Summit - From Contribution to Authorship
London Community Summit - From Contribution to Authorship
 
London Community Summit 2016 - Chef Automate
London Community Summit 2016 - Chef AutomateLondon Community Summit 2016 - Chef Automate
London Community Summit 2016 - Chef Automate
 
London Community Summit 2016 - Community Update
London Community Summit 2016 - Community UpdateLondon Community Summit 2016 - Community Update
London Community Summit 2016 - Community Update
 
London Community Summit 2016 - Habitat
London Community Summit 2016 -  HabitatLondon Community Summit 2016 -  Habitat
London Community Summit 2016 - Habitat
 
Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4Compliance Automation with Inspec Part 4
Compliance Automation with Inspec Part 4
 
Compliance Automation with Inspec Part 3
Compliance Automation with Inspec Part 3Compliance Automation with Inspec Part 3
Compliance Automation with Inspec Part 3
 
Compliance Automation with Inspec Part 2
Compliance Automation with Inspec Part 2Compliance Automation with Inspec Part 2
Compliance Automation with Inspec Part 2
 
Compliance Automation with Inspec Part 1
Compliance Automation with Inspec Part 1Compliance Automation with Inspec Part 1
Compliance Automation with Inspec Part 1
 
Application Automation with Habitat
Application Automation with HabitatApplication Automation with Habitat
Application Automation with Habitat
 
Achieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef AutomateAchieving DevOps Success with Chef Automate
Achieving DevOps Success with Chef Automate
 
Nike pop up habitat
Nike pop up   habitatNike pop up   habitat
Nike pop up habitat
 
Nike popup compliance workshop
Nike popup compliance workshopNike popup compliance workshop
Nike popup compliance workshop
 
Chef Automate Workflow Demo
Chef Automate Workflow DemoChef Automate Workflow Demo
Chef Automate Workflow Demo
 

Kürzlich hochgeladen

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Environments - Fundamentals Webinar Series Week 5

  • 2. Nathen Harvey • Community Director • Co-host of the Food Fight Show Podcast ! • @nathenharvey
  • 3. Questions & Answers • Ask questions in the chat window when they come to you • We’ll answer as many questions as we can at the end of the session
  • 4. Questions & Answers • Ask questions in the Google Discussion Forum ! • This can be used during the webinar and outside of the webinar, too. ! • https://groups.google.com/d/ forum/learnchef-fundamentals- webinar
  • 5. Slides and Video • This webinar is being recorded. The video will be made available shortly after the session has ended. ! • The slides used throughout this webinar will be made available at the end of each webinar. ! • Watch http://learnchef.com for updates.
  • 6. Topics • Overview of Chef • Workstation Setup • Node Setup • Chef Resources and Recipes • Working with the Node object • Roles • Common configuration with Data Bags • Environments • Community Cookbooks and Further Resources
  • 8. In the last module • Refactored our apache cookbook to include multiple sites 8
  • 9. Where did my Node go? • We still need a CentOS machine to manage • The one we launched last time has likely expired • Launch a new one using the Chef Lab • Hopefully, you’ve already done this. We’re not going to spend time walking through it now. 9
  • 11. $ ssh root@<EXTERNAL_ADDRESS> Lab - Login The authenticity of host 'uvo1qrwls0jdgs3blvt.vm.cld.sr (69.195.232.110)' can't be established.! RSA key fingerprint is d9:95:a3:b9:02:27:e9:cd: 74:e4:a2:34:23:f5:a6:8b.! Are you sure you want to continue connecting (yes/no)? yes! Warning: Permanently added 'uvo1qrwls0jdgs3blvt.vm.cld.sr, 69.195.232.110' (RSA) to the list of known hosts.! chef@uvo1qrwls0jdgs3blvt.vm.cld.sr's password: ! Last login: Mon Jan 6 16:26:24 2014 from host86-145-117-53.range86-145.btcentralplus.com! [chef@CentOS63 ~]$ 11
  • 12. $ knife bootstrap <EXTERNAL_ADDRESS> -x root -P chef -N ‘module5’ -r ‘role[webserver]’ "Bootstrap" the Target Instance Bootstrapping Chef on uvo1qrwls0jdgs3blvt.vm.cld.sr! ...! ...! uvo1qrwls0jdgs3blvt.vm.cld.sr Creating a new client identity for module3 using the validator key.! uvo1qrwls0jdgs3blvt.vm.cld.sr resolving cookbooks for run list: []! uvo1qrwls0jdgs3blvt.vm.cld.sr Synchronizing Cookbooks:! uvo1qrwls0jdgs3blvt.vm.cld.sr Compiling Cookbooks...! uvo1qrwls0jdgs3blvt.vm.cld.sr [2014-01-28T11:03:14-05:00] WARN: Node module3 has an empty run list.! uvo1qrwls0jdgs3blvt.vm.cld.sr Converging 0 resources! uvo1qrwls0jdgs3blvt.vm.cld.sr Chef Client finished, 0 resources updated 12
  • 13. Exercise: Verify that the home page works • Open a web browser • Type in the the URL for your test node 13
  • 15. 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 • Explain when to set attributes in an environment 15
  • 17. Environments • Every Organization starts with a single environment • Environments reflect your patterns and workflow • Development • Test • Staging • Production • etc. 17
  • 18. 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
  • 19. Environment Best Practice • We cannot share cookbooks between organizations • 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
  • 20. $ knife cookbook show apache Exercise: Use knife to show the available cookbook versions apache 0.2.0 0.1.0 20
  • 21. Exercise: List current environments _default • The _default environment is read-only, and sets no policy at all 21
  • 22. $ knife environment list Exercise: List current environments _default • The _default environment is read-only, and sets no policy at all 21
  • 23. $ mkdir environments Make an environments directory (No output) 22
  • 24. OPEN IN EDITOR: SAVE FILE! environments/dev.rb name "dev"! description "For developers!"! cookbook "apache", "= 0.2.0" Exercise: Create a dev environment • Environments have names • Environments have a description • Environments can have one or more cookbook constraints 23
  • 25. • = Equal to • There are other options but equality is the recommended practice. • Learn more at http://docs.opscode.com/chef/ essentials_cookbook_versions.html Cookbook Version Constraints 24
  • 26. Exercise: Create the dev environment Updated Environment dev 25
  • 27. $ knife environment from file dev.rb Exercise: Create the dev environment Updated Environment dev 25
  • 28. Exercise: Show your dev environment chef_type: environment! cookbook_versions: ! apache: = 0.2.0! default_attributes: ! description: For developers!! json_class: Chef::Environment! name: dev! override_attributes: 26
  • 29. $ knife environment show dev Exercise: Show your dev environment chef_type: environment! cookbook_versions: ! apache: = 0.2.0! default_attributes: ! description: For developers!! json_class: Chef::Environment! name: dev! override_attributes: 26
  • 30. Exercise: Change your node’s environment to "dev" • Click the ‘Nodes’ tab then select node ‘module5’ • Select dev from the ‘Environments’ drop-down list • Click ‘Save’ 27
  • 31. Exercise: Re-run the Chef Client INFO: Chef Run complete in 1.587776095 seconds! INFO: Running report handlers! INFO: Report handlers complete 28
  • 32. chef@module5$ sudo chef-client Exercise: Re-run the Chef Client INFO: Chef Run complete in 1.587776095 seconds! INFO: Running report handlers! INFO: Report handlers complete 28
  • 33. name "production"! description "For Production!"! cookbook "apache", "= 0.1.0"! OPEN IN EDITOR: environments/production.rb SAVE FILE! Exercise: Create a production environment • Make sure the apache cookbook is set to version 0.1.0 29
  • 34. Exercise: Create the production environment Updated Environment production 30
  • 35. $ knife environment from file production.rb Exercise: Create the production environment Updated Environment production 30
  • 36. Exercise: Change your node’s environment to "production" • Click the ‘Nodes’ tab then select node ‘module5’ • Select production from the ‘Environments’ drop-down list • Click ‘Save’ 31
  • 37. Exercise: Re-run the Chef Client INFO: Loading cookbooks [apache, motd, pci, users]! Synchronizing Cookbooks:! ...! Recipe: motd::default! * template[/etc/motd] action create[2014-01-07T08:40:00-05:00] INFO: Processing template[/etc/motd] action create (motd::default line 9)! [2014-01-07T08:40:00-05:00] INFO: template[/etc/motd] backed up to /var/chef/backup/etc/motd.chef-20140107084000.070961! [2014-01-07T08:40:00-05:00] INFO: template[/etc/motd] updated file contents /etc/motd! ! - update content in file /etc/motd from d36e1f to 62ebb9! (current file is binary, diff output suppressed)! ...! * cookbook_file[/var/www/index.html] action create[2014-01-07T08:40:05-05:00] INFO: Processing cookbook_file[/var/ www/index.html] action create (apache::default line 18)! (up to date)! [2014-01-07T08:40:06-05:00] INFO: Chef Run complete in 8.048307322 seconds! [2014-01-07T08:40:06-05:00] INFO: Removing cookbooks/apache/templates/default/index.html.erb from the cache; it is no longer needed by chef-client.! [2014-01-07T08:40:06-05:00] INFO: Removing cookbooks/apache/templates/default/custom.erb from the cache; it is no longer needed by chef-client. 32
  • 38. chef@module5$ sudo chef-client Exercise: Re-run the Chef Client INFO: Loading cookbooks [apache, motd, pci, users]! Synchronizing Cookbooks:! ...! Recipe: motd::default! * template[/etc/motd] action create[2014-01-07T08:40:00-05:00] INFO: Processing template[/etc/motd] action create (motd::default line 9)! [2014-01-07T08:40:00-05:00] INFO: template[/etc/motd] backed up to /var/chef/backup/etc/motd.chef-20140107084000.070961! [2014-01-07T08:40:00-05:00] INFO: template[/etc/motd] updated file contents /etc/motd! ! - update content in file /etc/motd from d36e1f to 62ebb9! (current file is binary, diff output suppressed)! ...! * cookbook_file[/var/www/index.html] action create[2014-01-07T08:40:05-05:00] INFO: Processing cookbook_file[/var/ www/index.html] action create (apache::default line 18)! (up to date)! [2014-01-07T08:40:06-05:00] INFO: Chef Run complete in 8.048307322 seconds! [2014-01-07T08:40:06-05:00] INFO: Removing cookbooks/apache/templates/default/index.html.erb from the cache; it is no longer needed by chef-client.! [2014-01-07T08:40:06-05:00] INFO: Removing cookbooks/apache/templates/default/custom.erb from the cache; it is no longer needed by chef-client. 32
  • 39. • Chef is not magic - it manages state for declared resources • We just rolled back to an earlier version of the apache cookbook • While the recipe applied fine, investigating the system will reveal Apache is still configured as it was in the 0.2.0 cookbook Rollbacks and Desired State Best Practice 33
  • 41. Six Week Series • Module 1 - Overview of Chef • Module 2 - Node Setup, Chef Resources & Recipes • Module 3 - Working with the Node object & Roles • June 10 - Common configuration data with Databags • Today - Environments • June 24 - Community Cookbooks and Further Resources ! ! • * Topics subject to change, schedule unlikely to change
  • 42. Sign-up for Webinar • http://pages.getchef.com/ cheffundamentalsseries.html
  • 43. Additional Resources • Chef Fundamentals Webinar Series • https://www.youtube.com/watch? v=S5lHUpzoCYo&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbum Z ! • Discussion group for webinar participants • https://groups.google.com/d/forum/learnchef-fundamentals-webinar 37
  • 44. Additional Resources • Learn Chef • http://learnchef.com ! • Documentation • http://docs.opscode.com 38