• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding Our Cookbook
 

Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding Our Cookbook

on

  • 4,844 views

 

Statistics

Views

Total Views
4,844
Views on SlideShare
4,774
Embed Views
70

Actions

Likes
1
Downloads
2,420
Comments
0

6 Embeds 70

http://learn.getchef.com 36
http://learnchef.cloud.corp.dig.com 18
http://localhost 9
http://www.toddpigram.com 4
http://3903790839621496042_083cc485d00621dd7830c55a70eae38d3825407a.blogspot.com 2
http://nontster.wordpress.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding Our Cookbook Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding Our Cookbook Presentation Transcript

    • Chef Fundamentals
    • Chef Client Run and Expanding Our Cookbook Chef Fundamentals Webinar Series - Module 4 training@opscode.com
    • Nathen Harvey • Technical Community Manager at Opscode • Co-host of the Food Fight Show Podcast • @nathenharvey • nharvey@opscode.com
    • Quick Recap
    • Checkpoint • In the last module we • bootstrapped a node using knife bootstrap • wrote a simple cookbook to deploy a simple webpage
    • Where'd my Node go? • You still need an Ubuntu 10.04+ machine to manage • Launch a new instance in the training lab • Fire up a new Vagrant • Launch an new AMI Instance
    • But it might not have worked • In some instances, the apt-cache was out of date • You can fix this! • sudo apt-get update
    • Fix it the Chef way! • Create an apt cookboook • Use an execute resource • Add to the run list
    • Dissecting your first chef-client run The Anatomy of a Chef run
    • Objectives • Describe the steps of a chef-client run • Describe the basic security model of Chef
    • chef-client
    • chef-client build node
    • chef-client build node Ohai! node_name platform platform_version
    • chef-client build node authenticate
    • chef-client build node expanded run list (recipes) authenticate sync cookbooks
    • chef-client build node authenticate load cookbooks sync cookbooks
    • chef-client build node authenticate converge load cookbooks sync cookbooks
    • chef-client build node authenticate converge load cookbooks sync cookbooks success?
    • chef-client build node authenticate converge load cookbooks sync cookbooks Yes success? node.save
    • chef-client build node authenticate converge load cookbooks sync cookbooks Yes node.save No exception success?
    • chef-client build node authenticate converge load cookbooks sync cookbooks Yes node.save notification handlers success? No exception
    • Private Keys • Chef Server requires keys to authenticate. • client.pem - private key for API client • validation.pem - private key for ORGNAMEvalidator • Next, let’s see how those are used...
    • /etc/chef/ client.pem?
    • /etc/chef/ client.pem? Yes Sign Requests
    • No /etc/chef/ client.pem? Yes Sign Requests /etc/chef/ validation.pem?
    • No /etc/chef/ client.pem? Yes Sign Requests No /etc/chef/ validation.pem? 401!
    • No /etc/chef/ client.pem? No /etc/chef/ validation.pem? Yes Yes Sign Requests Request API Client 401!
    • No /etc/chef/ client.pem? No /etc/chef/ validation.pem? Yes Yes Sign Requests Request API Client client.pem 401!
    • No /etc/chef/ client.pem? No /etc/chef/ validation.pem? Yes Yes Sign Requests Request API Client client.pem 401!
    • Compile and Execute • Compile a Resource Collection • Execute the Resources in that Collection
    • Introducing the Node object Attributes & Search
    • Lesson Objectives • After completing the lesson, you will be able to • Explain what the Node object represents in Chef • List the Nodes in an organization • Show details about a Node • Describe what Node Attributes are • Retrieve a node attribute directly, and via search
    • What is the Node object • A node is any physical, virtual, or cloud machines that is configured to be maintained by a Chef • When you are writing Recipes, the Node object is always available to you.
    • Exercise: List nodes $ knife node list target1
    • Exercise: List clients $ knife client list ORGNAME-validator target1
    • Each node must have a unique name • Every node must have a unique name within an organization • Chef defaults to the Fully Qualified Domain Name of the server, i.e. in the format server.domain.com • We overrode it to "target1" to make typing easier
    • Exercise: Show node details $ knife node show target1 Node Name: Environment: FQDN: IP: Run List: Roles: Recipes: Platform: Tags: target1 _default ip-10-154-155-107.ec2.internal 54.242.35.165 ubuntu 12.04
    • What is the Node object • Nodes are made up of Attributes • Many are discovered automatically (platform, ip address, number of CPUs) • Many other objects in Chef can also add Node attributes (Cookbooks, Roles and Environments, Recipes, Attribute Files) • Nodes are stored and indexed on the Chef Server
    • Exercise: Run Ohai on node opscode@target1:~$ sudo ohai | less { "languages": { "ruby": { }, "python": { "version": "2.7.3", "builddate": "Apr 10 2013, 06:20:15" }, "perl": { "version": "5.14.2", "archname": "x86_64-linux-gnu-thread-multi" } }, "kernel": {
    • Exercise: Show all the node attributes $ knife node show target1 -l Node Name: Environment: FQDN: IP: Run List: Roles: Recipes: Platform: Tags: Attributes: tags: target1 _default ip-10-154-155-107.ec2.internal 54.242.35.165 ubuntu 12.04 Default Attributes: Override Attributes: Automatic Attributes (Ohai Data): block_device: loop0: removable: 0 size: 0
    • Exercise: Show the raw node object $ knife node show target1 -Fj { "name": "target1", "chef_environment": "_default", "run_list": [], "normal": {"tags":[]} }
    • Exercise: Show only the fqdn attribute $ knife node show target1 -a fqdn target1: fqdn: ip-10-154-155-107.ec2.internal
    • Exercise: Use search to find the same data $ knife search node "*:*" -a fqdn 1 items found target1: fqdn: ip-10-154-155-107.ec2.internal
    • Templates and Cross-platform Revisit the Apache Cookbook