Cooking with Chef

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Cooking with Chef - Presentation Transcript

    1. In the Kitchen Cooking with Chef
    2. Tyler Hunt @tylerhunt
    3. homegrown apps
    4. Tweeter Phone listen to your tweets
    5. Problem
    6. System Administration
    7. Configuration Management
    8. External DSL vs. Internal DSL
    9. SSL vs. OpenID
    10. XML-RPC vs. RESTful
    11. Test::Unit + RSpec + Mocha vs. RSpec
    12. Lines of Code Puppet Chef http://www.ohloh.net/p/compare?project_0=puppet&project_1=opscode-chef
    13. gem install chef
    14. Opscode
    15. “Chef is a state based, declarative configuration management engine.You define recipes of how you want your system to look and then chef makes it so.” — Ezra Zygmuntowicz
    16. OHAI
    17. gem install ohai
    18. ./bin/ohai
    19. { \"kernel\": { \"machine\": \"x86_64\", \"name\": \"Linux\", \"os\": \"GNU\\/Linux\", \"version\": \"#1 SMP Wed Aug 20 21:08:51 UTC 2008\", \"release\": \"2.6.24-19-xen\" }, \"uptime_seconds\": 12043422, \"platform_version\": \"8.04\", \"platform\": \"ubuntu\", \"virtualization\": { \"role\": \"guest\", \"emulator\": \"xen\" }, \"os\": \"linux\", \"idletime\": \"115 days 23 hours 34 minutes 06 seconds\", \"idletime_seconds\": 10020846, \"lsb\": { \"id\": \"Ubuntu\", \"description\": \"\\\"Ubuntu 8.04.1\\\"\", \"codename\": \"hardy\", \"release\": \"8.04\" }, \"os_version\": \"2.6.24-19-xen\" }
    20. Nodes
    21. Cookbooks
    22. Recipes
    23. Definitions def•i•ni•tions (děf'ə-nĭsh'ənz) n. pl.
    24. Attributes
    25. Libraries
    26. Files
    27. Templates Templates Templates Templates Templates Templates Templates
    28. cookbooks/ my_cookbook/ attributes/ definitions/ files/ libraries/ recipes/ templates/
    29. gems Mash.new unless attribute?(\"gems\") gems[:rake] ||= { :version => \"0.8.3\" } gems[:nokogiri] ||= { :version => \"1.0.5\" :source => \"http://gems.github.com/\" }
    30. { \"gems\": { \"rake\": { \"version\": \"0.8.3\" }, \"nokogiri\": { \"version\": \"1.0.5\", \"source\": \"http://gems.github.com\" } } }
    31. node[:gems].each do |name, gem| gem_package name do version gem[:version] if gem[:version] source gem[:source] if gem[:source] action :install end end
    32. node[:gems].each do |name, gem| gem_package name do version gem[:version] if gem[:version] source gem[:source] if gem[:source] action :install end end
    33. Resources Α Β Γ
    34. cron execute directory file group user link package remote_directory remote_file route script service template http_request
    35. Providers
    36. node[:gems].each do |name, gem| gem_package name do version gem[:version] if gem[:version] source gem[:source] if gem[:source] action :install end end
    37. directory \"/tmp/something\" do owner \"root\" group \"root\" mode 0755 action :create end
    38. file \"/tmp/something\" do owner \"root\" group \"root\" mode 0755 action :touch end
    39. cron \"noop\" do hour \"5\" command \"/bin/true\" end
    40. execute \"slapadd\" do command \"slapadd < /tmp/something.ldif\" creates \"/var/lib/slapd/uid.bdb\" action :run end
    41. group \"admin\" do gid 999 end
    42. user \"random\" do comment \"Random User\" uid \"1000\" gid \"users\" home \"/home/random\" shell \"/bin/zsh\" password \"$1$JJsvHslV$szsCjVEroftprNn4JHtDi.\" end
    43. link \"/tmp/passwd\" do to \"/etc/passwd\" link_type :symbolic end
    44. package \"tar\" do version \"1.16.1-1\" action :install end
    45. # file from cookbook remote_file \"/tmp/test\" do source \"test\" mode 0644 end # file from remote source remote_file \"/tmp/testfile\" do source \"http://example.com/files/test\" mode 0644 end
    46. remote_directory \"/tmp/remote_something\" do source \"something\" files_backup 10 files_owner \"root\" files_group \"root\" files_mode 0644 owner \"nobody\" group \"nobody\" mode 0755 end
    47. route \"20.0.0.0\" do gateway \"10.0.0.20\" metric 5 route_type :net netmask \"255.255.0.0\" end
    48. script \"install_something\" do interpreter \"bash\" user \"root\" cwd \"/tmp\" code <<-EOH wget http://example.com/tarball.tar.gz tar -zxf tarball.tar.gz cd tarball ./configure make make install EOH end
    49. service \"example_service\" do case node[:platform] when \"CentOS\", \"RedHat\", \"Fedora\" service_name \"redhat_name\" else service_name \"other_name\" end supports :restart => true action [ :enable, :start ] end
    50. template \"/etc/config.conf\" do source \"config.conf.erb\" variables({ :timeout => 360 }) end
    51. http_request \"posting data\" do url \"http://example.com/check_in\" message :some => \"data\" end
    52. http://flickr.com/photos/philipyk/160559925/ http://flickr.com/photos/florin_mogos/2523984446/ http://flickr.com/photos/giorgiocardellini/271092412/ http://flickr.com/photos/onkel_wart/2487637968/ http://flickr.com/photos/dunechaser/161509118/
    53. http://radlab.cs.berkeley.edu/wiki/Chef http://junglist.gen.nz/chef-vs-puppet/ http://wiki.opscode.com/display/chef/Home http://brainspl.at/articles/2009/01/15/ http://brainspl.at/articles/2009/01/31/
    54. Thank You
    SlideShare Zeitgeist 2009

    + Orlando_Ruby_Users_GroupOrlando_Ruby_Users_Group Nominate

    custom

    445 views, 0 favs, 0 embeds more stats

    If you’re tired of running the same commands over more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 445
      • 445 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 20
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories