SlideShare a Scribd company logo
1 of 57
Download to read offline
Cookbooks
Organizing Recipes
Slide 1 of 57
After completing this module, you should be able to:
Modify a recipe
Use version control
Generate a Chef cookbook
Define a Chef recipe that sets up a web server
Objectives
Slide 2 of 57
Questions You May Have
Slide 3 of 57
Thinking about the workstation recipe, could we do
something like that for a web server?
Questions You May Have
Slide 4 of 57
Thinking about the workstation recipe, could we do
something like that for a web server?
Is there a way to package up recipes you create with a
version number (and maybe a README)?
Questions You May Have
Slide 5 of 57
Thinking about the workstation recipe, could we do
something like that for a web server?
Is there a way to package up recipes you create with a
version number (and maybe a README)?
I think Chef is able to generate something called a
cookbook. Shouldn't we start thinking about some
version control so we don't lose all our hard work?
Questions You May Have
Slide 6 of 57
Slide 7 of 57
Versioning Pros and Cons
Slide 8 of 57
Versioning Pros and Cons
Saving a copy of the original file as another filename.
$cpsetup.rbsetup.rb.bak
Slide 9 of 57
Versioning Pros and Cons
Saving a copy of the original file as another filename.
$cpsetup.rbsetup.rb.bak
or
$cpsetup.rb{,.`date+%Y%m%d%H%M`}
Slide 10 of 57
Versioning Pros and Cons
Saving a copy of the original file as another filename.
$cpsetup.rbsetup.rb.bak
or
$cpsetup.rb{,.`date+%Y%m%d%H%M`}
or
$cpsetup.rb{,.`date+%Y%m%d%H%M-$USER`}
Slide 11 of 57
Git Version Control
git is a distributed revision control system with an emphasis on speed, data
integrity, and support for distributed, non-linear workflows.
We will be using git throughout the rest of this workshop.
Slide 12 of 57
Add the additional policy to setup.rb:
The package named git is installed.
Then apply this recipe with chef-apply.
Lab Exercise: Install git
Slide 13 of 57
Lab Exercise: Adding the git Package
~/setup.rb
package'nano'
package'vim'
package'emacs'
package'tree'
package'git'
file'/etc/motd'do
content'Propertyof...'
end
Slide 14 of 57
Lab Exercise: Re-apply the Setup Recipe
$sudochef-applysetup.rb
Recipe:(chef-applycookbook)::(chef-applyrecipe)
*yum_package[nano]actioninstall(uptodate)
*yum_package[vim]actioninstall(uptodate)
*yum_package[emacs]actioninstall(uptodate)
*yum_package[tree]actioninstall(uptodate)
*yum_package[git]actioninstall
-installversion1.7.1-4.el6_7.1ofpackagegit
*file[/etc/motd]actioncreate(uptodate)
Slide 15 of 57
How are we going to manage this file?
Does it need a README?
Group Exercise: Create a Cookbook
Slide 16 of 57
How are we going to manage this file?
Does it need a README?
Objective:
☐ Use chef (CLI) to generate a cookbook to store our setup
recipe.
☐ Add the workstation cookbook to version control.
Group Exercise: Create a Cookbook
Slide 17 of 57
What is chef?
An executable program that allows you generate cookbooks and cookbook
components.
Slide 18 of 57
What can chef do?
$chef--help
Usage:
chef-h/--help
chef-v/--version
chefcommand[arguments...][options...]
AvailableCommands:
exec Runsthecommandincontextoftheembeddedruby
env PrintsenvironmentvariablesusedbyChefDK
gem Runsthegemcommandincontextoftheembeddedruby
generate Generateanewapp,cookbook,orcomponent
shell-init InitializeyourshelltouseChefDKasyourprimaryruby
install InstallcookbooksfromaPolicyfileandgeneratealockedcookbookset
update UpdatesaPolicyfile.lock.jsonwithlatestrun_listandcookbooks
...
undelete Undoadeletecommand
verify TesttheembeddedChefDKapplications
Slide 19 of 57
Cookbooks
What is a Chef Cookbook?
Slide 20 of 57
A Chef Cookbook is the fundamental unit of
configuration and policy distribution.
Cookbooks
What is a Chef Cookbook?
Slide 21 of 57
A Chef Cookbook is the fundamental unit of
configuration and policy distribution.
Each cookbook defines a scenario, such as everything
needed to install and configure MySQL, and then it
contains all of the components that are required to
support that scenario.
Cookbooks
What is a Chef Cookbook?
Slide 22 of 57
A Chef Cookbook is the fundamental unit of
configuration and policy distribution.
Each cookbook defines a scenario, such as everything
needed to install and configure MySQL, and then it
contains all of the components that are required to
support that scenario.
Read the first three paragraphs here:
http://docs.chef.io/cookbooks.html
Cookbooks
What is a Chef Cookbook?
Slide 23 of 57
What Can chef generate Do?
$chefgenerate--help
Usage:chefgenerateGENERATOR[options]
Availablegenerators:
app Generateanapplicationrepo
cookbook Generateasinglecookbook
recipe Generateanewrecipe
attribute Generateanattributesfile
template Generateafiletemplate
file Generateacookbookfile
lwrp Generatealightweightresource/provider
repo GenerateaChefpolicyrepository
policyfile GenerateaPolicyfileforusewiththeinstall/pushcommands
generator CopyChefDK'sgeneratorcookbooksoyoucancustomizeit
Slide 24 of 57
What Can chef generate cookbook Do?
$chefgeneratecookbook--help
Usage:chefgeneratecookbookNAME[options]
-C,--copyrightCOPYRIGHT Nameofthecopyrightholder-default...
-m,--emailEMAIL Emailaddressoftheauthor-defaults...
-a,--generator-argKEY=VALUE UsetosetarbitraryattributeKEYto...
-I,--licenseLICENSE all_rights,httpd,mit,gplv2,gplv3-...
-gGENERATOR_COOKBOOK_PATH, UseGENERATOR_COOKBOOK_PATHforthe...
--generator-cookbook
Slide 25 of 57
Group Exercise: Let's Create a Cookbook
$cd~
$chefgeneratecookbookworkstation
InstallingCookbookGems:
CompilingCookbooks...
Recipe:code_generator::cookbook
*directory[/home/bmeyer/workstation]actioncreate
-createnewdirectory/home/bmeyer/workstation
*template[/home/bmeyer/workstation/metadata.rb]actioncreate_if_missing
-createnewfile/home/bmeyer/workstation/metadata.rb
-updatecontentinfile/home/bmeyer/workstation/metadata.rbfromnoneto0c09e4
(diffoutputsuppressedbyconfig)
*template[/home/bmeyer/workstation/README.md]actioncreate_if_missing
-createnewfile/home/bmeyer/workstation/README.md
-updatecontentinfile/home/bmeyer/workstation/README.mdfromnoneto590727
(diffoutputsuppressedbyconfig)
...
*execute[initialize-git]actionrun
-executegitinit.
*cookbook_file[/home/bmeyer/workstation/.gitignore]actioncreate
-createnewfile/home/bmeyer/workstation/.gitignore
-updatecontentinfile/home/bmeyer/workstation/.gitignorefromnonetodd37b2
(diffoutputsuppressedbyconfig)
Slide 26 of 57
Group Exercise: The Cookbook Has a README.md file
$treeworkstation
workstation
├──Berksfile
├──chefignore
├──metadata.rb
├──README.md
├──recipes
│ └──default.rb
├──spec
│ ├──spec_helper.rb
...
└──test
└──integration
...
└──helpers
└──serverspec
└──spec_helper.rb
10directories,9files
Slide 27 of 57
The description of the cookbook's features written in
Markdown.
README.md
http://daringfireball.net/projects/markdown/syntax
Slide 28 of 57
Group Exercise: The Cookbook Has Some Metadata
$treeworkstation
workstation
├──Berksfile
├──chefignore
├──metadata.rb
├──README.md
├──recipes
│ └──default.rb
├──spec
│ ├──spec_helper.rb
│ └──unit
│ └──recipes
│ └──default_spec.rb
10directories,9files
Slide 29 of 57
Every cookbook requires a small amount of metadata.
metadata.rb
Slide 30 of 57
Every cookbook requires a small amount of metadata.
Metadata is stored in a file called metadata.rbthat
lives at the top of each cookbook’s directory.
metadata.rb
http://docs.chef.io/config_rb_metadata.html
Slide 31 of 57
Group Exercise: Let's Take a Look at the Metadata
$catworkstation/metadata.rb
name 'workstation'
maintainer 'TheAuthors'
maintainer_email'you@example.com'
license 'all_rights'
description 'Installs/Configuresworkstation'
long_description'Installs/Configuresworkstation'
version '0.1.0'
Slide 32 of 57
Group Exercise: The Cookbook Has a Folder for Recipes
$treeworkstation
workstation
├──Berksfile
├──chefignore
├──metadata.rb
├──README.md
├──recipes
│ └──default.rb
├──spec
│ ├──spec_helper.rb
│ └──unit
│ └──recipes
│ └──default_spec.rb
10directories,9files
Slide 33 of 57
Group Exercise: The Cookbook Has a Default Recipe
$catworkstation/recipes/default.rb
#CookbookName::workstation
#Recipe::default
#
#Copyright(c)2015TheAuthors,AllRightsReserved.
Slide 34 of 57
Group Exercise: Move our setup.rb Recipe into the Cookbook
$mv-vsetup.rbworkstation/recipes/
`setup.rb'->`workstation/recipes/setup.rb'
Slide 35 of 57
This is a probably a good point to capture the initial state
of our cookbook.
Objective:
☑ Use chef (CLI) to generate a cookbook to store our setup
recipe.
☐ Add the workstation cookbook to version control.
Group Exercise: Version Control
Slide 36 of 57
Group Exercise: Move into the Cookbook Directory
$cdworkstation
Slide 37 of 57
Group Exercise: Initialize the Directory as a git Repository
$gitinit
ReinitializedexistingGitrepositoryin/home/chef/workstation/.git/
Slide 38 of 57
Group Exercise: Use git add to Stage Files to be Committed
$gitadd.
Slide 39 of 57
The staging area has a file, generally contained in
your Git directory, that stores information about what
will go into your next commit.
It’s sometimes referred to as the “index”, but it’s also
common to refer to it as the staging area.
Staging Area
http://git-scm.com/book/en/v2/Getting-Started-Git-Basics
Slide 40 of 57
Group Exercise: Use git status to View the Staged Files
$gitstatus
#Onbranchmaster
#
#Initialcommit
#
#Changestobecommitted:
# (use"gitrm--cached<file>..."tounstage)
#
# newfile: .gitignore
# newfile: .kitchen.yml
# newfile: Berksfile
# newfile: README.md
# newfile: chefignore
# newfile: metadata.rb
# newfile: recipes/default.rb
# newfile: recipes/setup.rb
# newfile: spec/spec_helper.rb
# newfile: spec/unit/recipes/default_spec.rb
# newfile: test/integration/default/serverspec/default_spec.rb
# newfile: test/integration/helpers/serverspec/spec_helper.rb
#
Slide 41 of 57
Group Exercise: Use git commit to Save the Staged Changes
$gitcommit-m"Initialworkstationcookbook"
[master(root-commit)ae6968b]Initialworkstationcookbook
Committer:ChefDKUser<chef@ip-172-31-11-224.ec2.internal>
Yournameandemailaddresswereconfiguredautomaticallybased
onyourusernameandhostname.Pleasecheckthattheyareaccurate.
Youcansuppressthismessagebysettingthemexplicitly:
gitconfig--globaluser.name"YourName"
gitconfig--globaluser.emailyou@example.com
Iftheidentityusedforthiscommitiswrong,youcanfixitwith:
gitcommit--amend--author='YourName<you@example.com>'
12fileschanged,207insertions(+),0deletions(-)
createmode100644.gitignore
createmode100644.kitchen.yml
createmode100644Berksfile
createmode100644README.md
createmode100644chefignore
createmode100644metadata.rb
createmode100644recipes/default.rb
createmode100644recipes/setup.rb
...
Slide 42 of 57
If you use git versioning you should ultimately push
the local git repository to a shared remote git
repository.
In this way others could collaborate with you from a
centralized location.
Git Version Control
Slide 43 of 57
Group Exercise: Move out of the Workstation Cookbook
$cd~
Slide 44 of 57
Use chef generate to create a cookbook named apache.
Write and apply a recipe named server.rbwith the
policy:
The package named httpd is installed.
The file named /var/www/html/index.htmlis
created with the content <h1>Hello,world!</h1>
The service named httpd is started and enabled.
Apply the recipe with chef-apply.
Verify the site is available by running curl
http://localhost.
Lab Exercise: Setting up a Web Server
Slide 45 of 57
Lab Exercise: Create a Cookbook
$chefgeneratecookbookapache
InstallingCookbookGems:
CompilingCookbooks...
Recipe:code_generator::cookbook
*directory[/home/bmeyer/apache]actioncreate
-createnewdirectory/home/bmeyer/apache
*template[/home/bmeyer/apache/metadata.rb]actioncreate_if_missing
-createnewfile/home/bmeyer/apache/metadata.rb
-updatecontentinfile/home/bmeyer/apache/metadata.rbfromnoneto37ed5f
(diffoutputsuppressedbyconfig)
*template[/home/bmeyer/apache/README.md]actioncreate_if_missing
-createnewfile/home/bmeyer/apache/README.md
-updatecontentinfile/home/bmeyer/apache/README.mdfromnoneto5c3d3a
(diffoutputsuppressedbyconfig)
...
*cookbook_file[/home/bmeyer/apache/.gitignore]actioncreate
-createnewfile/home/bmeyer/apache/.gitignore
-updatecontentinfile/home/bmeyer/apache/.gitignorefromnonetodd37b2
(diffoutputsuppressedbyconfig)
Slide 46 of 57
Lab Exercise: Create a Cookbook
$chefgeneraterecipeapacheserver
InstallingCookbookGems:
CompilingCookbooks...
Recipe:code_generator::recipe
*directory[./apache/spec/unit/recipes]actioncreate(uptodate)
*cookbook_file[./apache/spec/spec_helper.rb]actioncreate_if_missing(uptodate)
*template[./apache/spec/unit/recipes/server_spec.rb]actioncreate_if_missing
-createnewfile./apache/spec/unit/recipes/server_spec.rb
-updatecontentinfile./apache/spec/unit/recipes/server_spec.rbfromnonetoa43970
(diffoutputsuppressedbyconfig)
*template[./apache/recipes/server.rb]actioncreate
-createnewfile./apache/recipes/server.rb
-updatecontentinfile./apache/recipes/server.rbfromnoneto3d6b92
(diffoutputsuppressedbyconfig)
Slide 47 of 57
Lab Exercise: Create the Server Recipe
~/apache/recipes/server.rb
package'httpd'
file'/var/www/html/index.html'do
content'<h1>Hello,world!</h1>'
end
service'httpd'do
action[:enable,:start]
end
Slide 48 of 57
Lab Exercise: Apply the Server Recipe
$sudochef-applyapache/recipes/server.rb
Recipe:(chef-applycookbook)::(chef-applyrecipe)
*yum_package[httpd]actioninstall
-installversion2.4.6-40.el7.centosofpackagehttpd
*file[/var/www/html/index.html]actioncreate
-createnewfile/var/www/html/index.html
-updatecontentinfile/var/www/html/index.htmlfromnoneto17d291
---/var/www/html/index.html 2016-04-0409:50:59.758483838-0500
+++/var/www/html/.chef-index.html20160404-21732-1o44k9g 2016-04-0409:50:59.758483838-0500
@@-1+1,2@@
+<h1>Hello,world!</h1>
*service[httpd]actionenable
-enableserviceservice[httpd]
*service[httpd]actionstart
-startserviceservice[httpd]
Slide 49 of 57
Lab Exercise: Verify Website is Available
$curllocalhost
<h1>Hello,world!</h1>
Slide 50 of 57
Group Exercise: Commit Your Work
$cdapache
$gitinit
$gitadd.
$gitcommit-m"InitialApacheCookbook"
Slide 51 of 57
What file would you read first when examining a
cookbook?
Discussion
Slide 52 of 57
What file would you read first when examining a
cookbook?
What other recipes might you include in the apache or
workstation cookbook?
Discussion
Slide 53 of 57
What file would you read first when examining a
cookbook?
What other recipes might you include in the apache or
workstation cookbook?
Can resources accept multiple actions?
Discussion
Slide 54 of 57
What file would you read first when examining a
cookbook?
What other recipes might you include in the apache or
workstation cookbook?
Can resources accept multiple actions?
How often would you commit changes with version
control?
Discussion
Slide 55 of 57
Cookbooks
Versions
Version control
Q&A
What questions can we answer for you?
Slide 56 of 57
On to Module 4
Slide 57 of 57

More Related Content

What's hot

Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5
Chef
 

What's hot (20)

Using Test Kitchen for testing Chef cookbooks
Using Test Kitchen for testing Chef cookbooksUsing Test Kitchen for testing Chef cookbooks
Using Test Kitchen for testing Chef cookbooks
 
Making TDD [Somewhat] Bearable on OpenStack
Making TDD [Somewhat] Bearable on OpenStackMaking TDD [Somewhat] Bearable on OpenStack
Making TDD [Somewhat] Bearable on OpenStack
 
Hand Crafted Artisanal Chef Resources
Hand Crafted Artisanal Chef ResourcesHand Crafted Artisanal Chef Resources
Hand Crafted Artisanal Chef Resources
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation Workshop
 
Chef training Day4
Chef training Day4Chef training Day4
Chef training Day4
 
Chef training Day5
Chef training Day5Chef training Day5
Chef training Day5
 
Chef training - Day3
Chef training - Day3Chef training - Day3
Chef training - Day3
 
What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)
 
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 training - Day2
Chef training - Day2Chef training - Day2
Chef training - Day2
 
Cookbook Reusability @ Chef Community summit 2014
Cookbook Reusability @ Chef Community summit 2014Cookbook Reusability @ Chef Community summit 2014
Cookbook Reusability @ Chef Community summit 2014
 
IT Automation with Chef
IT Automation with ChefIT Automation with Chef
IT Automation with Chef
 
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
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5
 
Drupal Deployment
Drupal DeploymentDrupal Deployment
Drupal Deployment
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.js
 
Test Driven Development with Chef
Test Driven Development with ChefTest Driven Development with Chef
Test Driven Development with Chef
 

Viewers also liked (10)

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...
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git Tutorial 教學
Git Tutorial 教學Git Tutorial 教學
Git Tutorial 教學
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git Right
 
[NDC16] Effective Git
[NDC16] Effective Git[NDC16] Effective Git
[NDC16] Effective Git
 
DevOps 101
DevOps 101DevOps 101
DevOps 101
 
DevOps
DevOpsDevOps
DevOps
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Introducing DevOps
Introducing DevOpsIntroducing DevOps
Introducing DevOps
 

Similar to Chef for beginners module 3

Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
Kenny Gryp
 

Similar to Chef for beginners module 3 (20)

Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with Jitterbug
 
The Berkshelf Way
The Berkshelf WayThe Berkshelf Way
The Berkshelf Way
 
Pyramid deployment
Pyramid deploymentPyramid deployment
Pyramid deployment
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef Opswork
 
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
 
What is Chef and how we use it at tripsta
What is Chef and how we use it at tripstaWhat is Chef and how we use it at tripsta
What is Chef and how we use it at tripsta
 
Manual 5
Manual 5Manual 5
Manual 5
 
Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
 
Chef infrastructure as code - paris.rb
Chef infrastructure as code - paris.rbChef infrastructure as code - paris.rb
Chef infrastructure as code - paris.rb
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetup
 
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | EdurekaDevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
DevOps Interview Questions and Answers 2019 | DevOps Tutorial | Edureka
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
 
Habitat Managed Chef
Habitat Managed ChefHabitat Managed Chef
Habitat Managed Chef
 
Microservice Teststrategie mit Symfony2
Microservice Teststrategie mit Symfony2Microservice Teststrategie mit Symfony2
Microservice Teststrategie mit Symfony2
 
Design Summit - Migrating to Ruby 2 - Joe Rafaniello
Design Summit - Migrating to Ruby 2 - Joe RafanielloDesign Summit - Migrating to Ruby 2 - Joe Rafaniello
Design Summit - Migrating to Ruby 2 - Joe Rafaniello
 
Consistent Development Environment using Vagrant and Chef
Consistent Development Environment using Vagrant and ChefConsistent Development Environment using Vagrant and Chef
Consistent Development Environment using Vagrant and Chef
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
DevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven InfrastructureDevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven Infrastructure
 
What Makes a Good Cookbook?
What Makes a Good Cookbook?What Makes a Good Cookbook?
What Makes a Good Cookbook?
 

More from Chef

More from Chef (20)

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
 
The caseforawesome
The caseforawesomeThe caseforawesome
The caseforawesome
 

Recently uploaded

Recently uploaded (20)

Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
Abortion Clinic In Stanger ](+27832195400*)[ 🏥 Safe Abortion Pills In Stanger...
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
 

Chef for beginners module 3

  • 2. After completing this module, you should be able to: Modify a recipe Use version control Generate a Chef cookbook Define a Chef recipe that sets up a web server Objectives Slide 2 of 57
  • 3. Questions You May Have Slide 3 of 57
  • 4. Thinking about the workstation recipe, could we do something like that for a web server? Questions You May Have Slide 4 of 57
  • 5. Thinking about the workstation recipe, could we do something like that for a web server? Is there a way to package up recipes you create with a version number (and maybe a README)? Questions You May Have Slide 5 of 57
  • 6. Thinking about the workstation recipe, could we do something like that for a web server? Is there a way to package up recipes you create with a version number (and maybe a README)? I think Chef is able to generate something called a cookbook. Shouldn't we start thinking about some version control so we don't lose all our hard work? Questions You May Have Slide 6 of 57
  • 8. Versioning Pros and Cons Slide 8 of 57
  • 9. Versioning Pros and Cons Saving a copy of the original file as another filename. $cpsetup.rbsetup.rb.bak Slide 9 of 57
  • 10. Versioning Pros and Cons Saving a copy of the original file as another filename. $cpsetup.rbsetup.rb.bak or $cpsetup.rb{,.`date+%Y%m%d%H%M`} Slide 10 of 57
  • 11. Versioning Pros and Cons Saving a copy of the original file as another filename. $cpsetup.rbsetup.rb.bak or $cpsetup.rb{,.`date+%Y%m%d%H%M`} or $cpsetup.rb{,.`date+%Y%m%d%H%M-$USER`} Slide 11 of 57
  • 12. Git Version Control git is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows. We will be using git throughout the rest of this workshop. Slide 12 of 57
  • 13. Add the additional policy to setup.rb: The package named git is installed. Then apply this recipe with chef-apply. Lab Exercise: Install git Slide 13 of 57
  • 14. Lab Exercise: Adding the git Package ~/setup.rb package'nano' package'vim' package'emacs' package'tree' package'git' file'/etc/motd'do content'Propertyof...' end Slide 14 of 57
  • 15. Lab Exercise: Re-apply the Setup Recipe $sudochef-applysetup.rb Recipe:(chef-applycookbook)::(chef-applyrecipe) *yum_package[nano]actioninstall(uptodate) *yum_package[vim]actioninstall(uptodate) *yum_package[emacs]actioninstall(uptodate) *yum_package[tree]actioninstall(uptodate) *yum_package[git]actioninstall -installversion1.7.1-4.el6_7.1ofpackagegit *file[/etc/motd]actioncreate(uptodate) Slide 15 of 57
  • 16. How are we going to manage this file? Does it need a README? Group Exercise: Create a Cookbook Slide 16 of 57
  • 17. How are we going to manage this file? Does it need a README? Objective: ☐ Use chef (CLI) to generate a cookbook to store our setup recipe. ☐ Add the workstation cookbook to version control. Group Exercise: Create a Cookbook Slide 17 of 57
  • 18. What is chef? An executable program that allows you generate cookbooks and cookbook components. Slide 18 of 57
  • 19. What can chef do? $chef--help Usage: chef-h/--help chef-v/--version chefcommand[arguments...][options...] AvailableCommands: exec Runsthecommandincontextoftheembeddedruby env PrintsenvironmentvariablesusedbyChefDK gem Runsthegemcommandincontextoftheembeddedruby generate Generateanewapp,cookbook,orcomponent shell-init InitializeyourshelltouseChefDKasyourprimaryruby install InstallcookbooksfromaPolicyfileandgeneratealockedcookbookset update UpdatesaPolicyfile.lock.jsonwithlatestrun_listandcookbooks ... undelete Undoadeletecommand verify TesttheembeddedChefDKapplications Slide 19 of 57
  • 20. Cookbooks What is a Chef Cookbook? Slide 20 of 57
  • 21. A Chef Cookbook is the fundamental unit of configuration and policy distribution. Cookbooks What is a Chef Cookbook? Slide 21 of 57
  • 22. A Chef Cookbook is the fundamental unit of configuration and policy distribution. Each cookbook defines a scenario, such as everything needed to install and configure MySQL, and then it contains all of the components that are required to support that scenario. Cookbooks What is a Chef Cookbook? Slide 22 of 57
  • 23. A Chef Cookbook is the fundamental unit of configuration and policy distribution. Each cookbook defines a scenario, such as everything needed to install and configure MySQL, and then it contains all of the components that are required to support that scenario. Read the first three paragraphs here: http://docs.chef.io/cookbooks.html Cookbooks What is a Chef Cookbook? Slide 23 of 57
  • 24. What Can chef generate Do? $chefgenerate--help Usage:chefgenerateGENERATOR[options] Availablegenerators: app Generateanapplicationrepo cookbook Generateasinglecookbook recipe Generateanewrecipe attribute Generateanattributesfile template Generateafiletemplate file Generateacookbookfile lwrp Generatealightweightresource/provider repo GenerateaChefpolicyrepository policyfile GenerateaPolicyfileforusewiththeinstall/pushcommands generator CopyChefDK'sgeneratorcookbooksoyoucancustomizeit Slide 24 of 57
  • 25. What Can chef generate cookbook Do? $chefgeneratecookbook--help Usage:chefgeneratecookbookNAME[options] -C,--copyrightCOPYRIGHT Nameofthecopyrightholder-default... -m,--emailEMAIL Emailaddressoftheauthor-defaults... -a,--generator-argKEY=VALUE UsetosetarbitraryattributeKEYto... -I,--licenseLICENSE all_rights,httpd,mit,gplv2,gplv3-... -gGENERATOR_COOKBOOK_PATH, UseGENERATOR_COOKBOOK_PATHforthe... --generator-cookbook Slide 25 of 57
  • 26. Group Exercise: Let's Create a Cookbook $cd~ $chefgeneratecookbookworkstation InstallingCookbookGems: CompilingCookbooks... Recipe:code_generator::cookbook *directory[/home/bmeyer/workstation]actioncreate -createnewdirectory/home/bmeyer/workstation *template[/home/bmeyer/workstation/metadata.rb]actioncreate_if_missing -createnewfile/home/bmeyer/workstation/metadata.rb -updatecontentinfile/home/bmeyer/workstation/metadata.rbfromnoneto0c09e4 (diffoutputsuppressedbyconfig) *template[/home/bmeyer/workstation/README.md]actioncreate_if_missing -createnewfile/home/bmeyer/workstation/README.md -updatecontentinfile/home/bmeyer/workstation/README.mdfromnoneto590727 (diffoutputsuppressedbyconfig) ... *execute[initialize-git]actionrun -executegitinit. *cookbook_file[/home/bmeyer/workstation/.gitignore]actioncreate -createnewfile/home/bmeyer/workstation/.gitignore -updatecontentinfile/home/bmeyer/workstation/.gitignorefromnonetodd37b2 (diffoutputsuppressedbyconfig) Slide 26 of 57
  • 27. Group Exercise: The Cookbook Has a README.md file $treeworkstation workstation ├──Berksfile ├──chefignore ├──metadata.rb ├──README.md ├──recipes │ └──default.rb ├──spec │ ├──spec_helper.rb ... └──test └──integration ... └──helpers └──serverspec └──spec_helper.rb 10directories,9files Slide 27 of 57
  • 28. The description of the cookbook's features written in Markdown. README.md http://daringfireball.net/projects/markdown/syntax Slide 28 of 57
  • 29. Group Exercise: The Cookbook Has Some Metadata $treeworkstation workstation ├──Berksfile ├──chefignore ├──metadata.rb ├──README.md ├──recipes │ └──default.rb ├──spec │ ├──spec_helper.rb │ └──unit │ └──recipes │ └──default_spec.rb 10directories,9files Slide 29 of 57
  • 30. Every cookbook requires a small amount of metadata. metadata.rb Slide 30 of 57
  • 31. Every cookbook requires a small amount of metadata. Metadata is stored in a file called metadata.rbthat lives at the top of each cookbook’s directory. metadata.rb http://docs.chef.io/config_rb_metadata.html Slide 31 of 57
  • 32. Group Exercise: Let's Take a Look at the Metadata $catworkstation/metadata.rb name 'workstation' maintainer 'TheAuthors' maintainer_email'you@example.com' license 'all_rights' description 'Installs/Configuresworkstation' long_description'Installs/Configuresworkstation' version '0.1.0' Slide 32 of 57
  • 33. Group Exercise: The Cookbook Has a Folder for Recipes $treeworkstation workstation ├──Berksfile ├──chefignore ├──metadata.rb ├──README.md ├──recipes │ └──default.rb ├──spec │ ├──spec_helper.rb │ └──unit │ └──recipes │ └──default_spec.rb 10directories,9files Slide 33 of 57
  • 34. Group Exercise: The Cookbook Has a Default Recipe $catworkstation/recipes/default.rb #CookbookName::workstation #Recipe::default # #Copyright(c)2015TheAuthors,AllRightsReserved. Slide 34 of 57
  • 35. Group Exercise: Move our setup.rb Recipe into the Cookbook $mv-vsetup.rbworkstation/recipes/ `setup.rb'->`workstation/recipes/setup.rb' Slide 35 of 57
  • 36. This is a probably a good point to capture the initial state of our cookbook. Objective: ☑ Use chef (CLI) to generate a cookbook to store our setup recipe. ☐ Add the workstation cookbook to version control. Group Exercise: Version Control Slide 36 of 57
  • 37. Group Exercise: Move into the Cookbook Directory $cdworkstation Slide 37 of 57
  • 38. Group Exercise: Initialize the Directory as a git Repository $gitinit ReinitializedexistingGitrepositoryin/home/chef/workstation/.git/ Slide 38 of 57
  • 39. Group Exercise: Use git add to Stage Files to be Committed $gitadd. Slide 39 of 57
  • 40. The staging area has a file, generally contained in your Git directory, that stores information about what will go into your next commit. It’s sometimes referred to as the “index”, but it’s also common to refer to it as the staging area. Staging Area http://git-scm.com/book/en/v2/Getting-Started-Git-Basics Slide 40 of 57
  • 41. Group Exercise: Use git status to View the Staged Files $gitstatus #Onbranchmaster # #Initialcommit # #Changestobecommitted: # (use"gitrm--cached<file>..."tounstage) # # newfile: .gitignore # newfile: .kitchen.yml # newfile: Berksfile # newfile: README.md # newfile: chefignore # newfile: metadata.rb # newfile: recipes/default.rb # newfile: recipes/setup.rb # newfile: spec/spec_helper.rb # newfile: spec/unit/recipes/default_spec.rb # newfile: test/integration/default/serverspec/default_spec.rb # newfile: test/integration/helpers/serverspec/spec_helper.rb # Slide 41 of 57
  • 42. Group Exercise: Use git commit to Save the Staged Changes $gitcommit-m"Initialworkstationcookbook" [master(root-commit)ae6968b]Initialworkstationcookbook Committer:ChefDKUser<chef@ip-172-31-11-224.ec2.internal> Yournameandemailaddresswereconfiguredautomaticallybased onyourusernameandhostname.Pleasecheckthattheyareaccurate. Youcansuppressthismessagebysettingthemexplicitly: gitconfig--globaluser.name"YourName" gitconfig--globaluser.emailyou@example.com Iftheidentityusedforthiscommitiswrong,youcanfixitwith: gitcommit--amend--author='YourName<you@example.com>' 12fileschanged,207insertions(+),0deletions(-) createmode100644.gitignore createmode100644.kitchen.yml createmode100644Berksfile createmode100644README.md createmode100644chefignore createmode100644metadata.rb createmode100644recipes/default.rb createmode100644recipes/setup.rb ... Slide 42 of 57
  • 43. If you use git versioning you should ultimately push the local git repository to a shared remote git repository. In this way others could collaborate with you from a centralized location. Git Version Control Slide 43 of 57
  • 44. Group Exercise: Move out of the Workstation Cookbook $cd~ Slide 44 of 57
  • 45. Use chef generate to create a cookbook named apache. Write and apply a recipe named server.rbwith the policy: The package named httpd is installed. The file named /var/www/html/index.htmlis created with the content <h1>Hello,world!</h1> The service named httpd is started and enabled. Apply the recipe with chef-apply. Verify the site is available by running curl http://localhost. Lab Exercise: Setting up a Web Server Slide 45 of 57
  • 46. Lab Exercise: Create a Cookbook $chefgeneratecookbookapache InstallingCookbookGems: CompilingCookbooks... Recipe:code_generator::cookbook *directory[/home/bmeyer/apache]actioncreate -createnewdirectory/home/bmeyer/apache *template[/home/bmeyer/apache/metadata.rb]actioncreate_if_missing -createnewfile/home/bmeyer/apache/metadata.rb -updatecontentinfile/home/bmeyer/apache/metadata.rbfromnoneto37ed5f (diffoutputsuppressedbyconfig) *template[/home/bmeyer/apache/README.md]actioncreate_if_missing -createnewfile/home/bmeyer/apache/README.md -updatecontentinfile/home/bmeyer/apache/README.mdfromnoneto5c3d3a (diffoutputsuppressedbyconfig) ... *cookbook_file[/home/bmeyer/apache/.gitignore]actioncreate -createnewfile/home/bmeyer/apache/.gitignore -updatecontentinfile/home/bmeyer/apache/.gitignorefromnonetodd37b2 (diffoutputsuppressedbyconfig) Slide 46 of 57
  • 47. Lab Exercise: Create a Cookbook $chefgeneraterecipeapacheserver InstallingCookbookGems: CompilingCookbooks... Recipe:code_generator::recipe *directory[./apache/spec/unit/recipes]actioncreate(uptodate) *cookbook_file[./apache/spec/spec_helper.rb]actioncreate_if_missing(uptodate) *template[./apache/spec/unit/recipes/server_spec.rb]actioncreate_if_missing -createnewfile./apache/spec/unit/recipes/server_spec.rb -updatecontentinfile./apache/spec/unit/recipes/server_spec.rbfromnonetoa43970 (diffoutputsuppressedbyconfig) *template[./apache/recipes/server.rb]actioncreate -createnewfile./apache/recipes/server.rb -updatecontentinfile./apache/recipes/server.rbfromnoneto3d6b92 (diffoutputsuppressedbyconfig) Slide 47 of 57
  • 48. Lab Exercise: Create the Server Recipe ~/apache/recipes/server.rb package'httpd' file'/var/www/html/index.html'do content'<h1>Hello,world!</h1>' end service'httpd'do action[:enable,:start] end Slide 48 of 57
  • 49. Lab Exercise: Apply the Server Recipe $sudochef-applyapache/recipes/server.rb Recipe:(chef-applycookbook)::(chef-applyrecipe) *yum_package[httpd]actioninstall -installversion2.4.6-40.el7.centosofpackagehttpd *file[/var/www/html/index.html]actioncreate -createnewfile/var/www/html/index.html -updatecontentinfile/var/www/html/index.htmlfromnoneto17d291 ---/var/www/html/index.html 2016-04-0409:50:59.758483838-0500 +++/var/www/html/.chef-index.html20160404-21732-1o44k9g 2016-04-0409:50:59.758483838-0500 @@-1+1,2@@ +<h1>Hello,world!</h1> *service[httpd]actionenable -enableserviceservice[httpd] *service[httpd]actionstart -startserviceservice[httpd] Slide 49 of 57
  • 50. Lab Exercise: Verify Website is Available $curllocalhost <h1>Hello,world!</h1> Slide 50 of 57
  • 51. Group Exercise: Commit Your Work $cdapache $gitinit $gitadd. $gitcommit-m"InitialApacheCookbook" Slide 51 of 57
  • 52. What file would you read first when examining a cookbook? Discussion Slide 52 of 57
  • 53. What file would you read first when examining a cookbook? What other recipes might you include in the apache or workstation cookbook? Discussion Slide 53 of 57
  • 54. What file would you read first when examining a cookbook? What other recipes might you include in the apache or workstation cookbook? Can resources accept multiple actions? Discussion Slide 54 of 57
  • 55. What file would you read first when examining a cookbook? What other recipes might you include in the apache or workstation cookbook? Can resources accept multiple actions? How often would you commit changes with version control? Discussion Slide 55 of 57
  • 56. Cookbooks Versions Version control Q&A What questions can we answer for you? Slide 56 of 57
  • 57. On to Module 4 Slide 57 of 57