Cooking with Chef
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Cooking with Chef

  • 905 views
Uploaded on

Discusses Chef basics with a focus on managing workflow and changes to your infrastructure

Discusses Chef basics with a focus on managing workflow and changes to your infrastructure

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
905
On Slideshare
905
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
15
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Cooking with ChefMichael Richardson @Mr_SPB
  • 2. Topics• What is Chef• chef-client software• What does “Infrastructure as code” look like• What’s in a Cookbook• Testing your infrastructure code• Workflow
  • 3. Chef Architecture
  • 4. Chef Client SoftwareCommands• ohai (nodes)• chef-client (nodes)• chef-solo (nodes)• shef (node / workstation)• knife (workstations / build hosts?)
  • 5. Infrastructure as Code
  • 6. What is a cookbook• Fundamental units in Chef• Encapsulate resources• Contains recipes
  • 7. Resources
  • 8. Want more resources?
  • 9. Enter LWRP
  • 10. The Common CookbookCooking 101Step 1 - Install some softwareStep 2 - Create a config file for the softwareStep 3 - Start the software and set it to alwaysstart on system boot
  • 11. The Common Cookbook• NTP example• chef-repo/cookbooks/ntp/recipes/default.rb
  • 12. Demo Time• NTP cookbook
  • 13. Config FilesWhat normally goes in a config file?• Credentials (eg for a DB)• Application config switches• Application settings• Information about the local node• Information about other nodes in your system
  • 14. Config FilesWhat normally goes in a config file?• Credentials (eg for a DB)• Application config switches• Application settings• Information about the local node• Information about other nodes in your systemWhere can we gather information from to• Chef Data Bags• Cookbook attributes• Node attributes• Peer node information via Chef search
  • 15. Config Files - examplescookbook/postgresql/recipes/server.rbcookbook/postgresql/templates/default/postgres_pg_hba.conf.erb
  • 16. Testing Tools• Vagrant• [http://vagrantup.com]• foodcritic• [http://acrmp.github.com/foodcritic/]• minitest-handler• [https://github.com/calavera/minitest-chef-handler]• chefspec• [https://github.com/acrmp/chefspec]• [https://github.com/customink/fauxhai]• test-kitchen• [https://github.com/opscode/test-kitchen]
  • 17. Cookbook WorkflowYou need to consider• Run chef-client as a daemon or on-demand• Version cookbooks• Push cookbook updates from your workstation or a build server• Use no-op or why-run options
  • 18. Questions
  • 19. QuestionsIs Chef Awesome?
  • 20. QuestionsIs Chef Awesome?
  • 21. Anymore Questions?