Chef

471 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
471
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Chef

  1. 1. Cooking With Juri Timoshin @
  2. 2. Chef is a systems integration framework  Ruby  Write recipe that describes a role  Integration through System or API calls  Powerful search to discover info about already existing infrastructure
  3. 3. Architecture Introduction
  4. 4. Managing Tools Knife knife sub-command [ARGUMENTS] (options)  Shef  Management Console
  5. 5. Recipe and Cookbook
  6. 6. Resources Discrete chunk of a systems configuration (i.e. file, script, package) Cross platform abstraction (i.e. package supports: apt, yum, zipper, rpm, macports ...) apt-get install tar package "tar" do action :install yum install tar end rpm -i tar
  7. 7. Providers Takes Resource Compares it to existing one Takes action specified Code in platform.rb
  8. 8. Installation  Ruby Gem  Apt Package (Ubuntu, Debian) Knife Bootstrap (For Nodes)
  9. 9. Enough Talking!
  10. 10. Anatomy Of Chef Run Convergence Compile - Resource Collection Execute - Configure Node
  11. 11. Lightweight Resources and Providers (LWRP) CBNAME/resources/mercurial.rbactions :sync, :cloneattribute :path, :kind_of => String, :name_attribute => trueattribute :repository, :kind_of => String, :required => trueattribute :revision, :kind_of => [Integer, String], :default => tipattribute :user, :kind_of => String, :required => trueattribute :group, :kind_of => String, :required => trueattribute :mode, :kind_of => String, :default => 0775
  12. 12. LWRP Continued CBNAME/providers/mercurial.rb action :clone do bash "clone repository" do action :nothing user new_resource.user group new_resource.group environment ({HOME => Etc.getpwnam(new_resource.user).dir}) creates "#{new_resource.path}/.hg" code "hg clone -r #{new_resource.revision} #{new_resource.repository} #{new_resource.path}" end.run_action :run end CBNAME_mercurial Some uniq name doUsage (in any cookbook that repository "https://some.repo.url/some/path"depends on our CBNAME): action :clone user jt group jt end
  13. 13. Links Wiki (http://wiki.opscode.com/) Community (http://community.opscode.com/) ● Cookbooks ● Blogposts ● FAQ ● Links Source Code https://github.com/opscode/chef
  14. 14. Thank You! Email: juri.timoshin@zeroturnaround.com Blog: http://dracoater.blogspot.com/ G+: Juri Timošin

×