cooking with chef

21
Cooking with Chef Michael Richardson @Mr_SPB

Upload: mrichardson

Post on 07-May-2015

548 views

Category:

Self Improvement


0 download

DESCRIPTION

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

TRANSCRIPT

  • 1.Cooking with ChefMichael Richardson @Mr_SPB

2. Topics What is Chef chef-client software What does Infrastructure as code look like Whats 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?