Introduction to chef framework

2,804 views

Published on

Presentation given at 3 December 2010 at SRUG meeting
http://srug.pl

Published in: Technology, Self Improvement
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,804
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
50
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Introduction to chef framework

  1. 1. Introduction to "Chef" framework Silesian Ruby Users Group Wojciech Wn¦trzak December 3, 2010
  2. 2. What Is Chef?Open Source (Apache License v. 2.0)FrameworkRubyInfrastructure conguration management tool
  3. 3. Chef Is YoungReleased on January 15th, 2009
  4. 4. Why To Use Chef?Only one administration guy in company?Forces order in systemExisting solutions for your problemsBest practices
  5. 5. How To Use Chef?chef-client + chef-serverchef-client + Opscode Platformchef-solo
  6. 6. Chef ServerRuby gem (chef-server)Stores cookbooksStores information about nodesAccessbile by REST API
  7. 7. Chef Server ElementsCouchDB stores node informationsSOLR data indexingRabbitMQ helps in indexingMerb API and web user interface
  8. 8. Chef Server ElementsCouchDB stores node informationsSOLR data indexingRabbitMQ helps in indexingMerb API and web user interface That is lot of stu !
  9. 9. Opscode PlatformFree plan (upto 5 nodes)Conguration step by stepOrganizations and users managment
  10. 10. Chef ClientRuby gem (chef)Runs on machine that we want to congureCommunicates with chef serverAuthenticates using RSA keys
  11. 11. Server Clients
  12. 12. Chef SoloPart of chef gemStandalone run (without connecting to server)Uses cookbooks from local tarballs
  13. 13. Simple WorkowWrite cookbook with recipeUpload it to chef serverDene run list by: editing node on chef server passing JSON le to chef-clientRun chef-client on desired machine
  14. 14. CookbooksCookbooks for Chef are like RubyGems for 1 Ruby1 I couldnt nd author
  15. 15. Cookbook Skeleton
  16. 16. Example Attributes Fileset[:postgresql][:version] = 8.4set[:postgresql][:dir] = /etc/postgresql/#{node[:postgresql][:version]}/main
  17. 17. PostgreSQL Server Recipeinclude_recipe postgresql::clientpackage postgresql-#{node[:postgresql][:version]}template #{node[:postgresql][:dir]}/postgresql.conf do source postgresql.conf.erb owner postgres group postgres mode 0600endservice postgresql-#{node[:postgresql][:version]} do action :startend
  18. 18. Recipe Featuresinclude_recipe postgresql::clientpackage postgresql-#{node[:postgresql][:version]}service postgresql do service_name postgresql-#{node[:postgresql][:version]} supports :restart = true, :status = true action :nothingendtemplate #{node[:postgresql][:dir]}/postgresql.conf do source postgresql.conf.erb owner postgres group postgres mode 0600 notifies :restart, service[postgresql]end
  19. 19. Package ProvidersAptYumMacPorts
  20. 20. Package ProvidersAptYumMacPorts Many more
  21. 21. Supported SystemsDebianGentooFreeBSDMacOSXSolaris
  22. 22. Supported SystemsDebianGentooFreeBSDMacOSXSolarisWindows
  23. 23. Supported SystemsDebianGentooFreeBSDMacOSXSolarisWindows And more
  24. 24. Resources2 package template le user execute script (bash, ruby, perl, python, csh) http_request deploy2 http://wiki.opscode.com/display/chef/Resources
  25. 25. Resources2 package template le user execute script (bash, ruby, perl, python, csh) http_request deploy Many more2 http://wiki.opscode.com/display/chef/Resources
  26. 26. Additional Tools - OhaiReleased as a gem ohaiCollects system conguration/informationReturns JSON
  27. 27. Additional Tools - KnifePart of chef gemConsole tool for chef server managment
  28. 28. Tips If using RVM, use rvmsudo for chef-client Take a look at chef bootstrap3 Remember that Ruby (Chef) uses sh, not bash 3 http://wiki.opscode.com/display/chef/Bootstrap+Chef+RubyGems+Installation
  29. 29. Useful Linkshttp://www.opscode.com/chef/http://help.opscode.com/faqs/start/how-to-get-startedhttp://cookbooks.opscode.com/https://github.com/opscode/cookbooks
  30. 30. Thank YouQuestions?

×