Your SlideShare is downloading. ×
0
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
DevOps and Chef
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

DevOps and Chef

8,675

Published on

DevOps as a buzzword has had a lot of attention recently. This presentation is my take on the origins and essence of the matter, as well as an introduction to how Chef, the open source configuration …

DevOps as a buzzword has had a lot of attention recently. This presentation is my take on the origins and essence of the matter, as well as an introduction to how Chef, the open source configuration management software, can help to solve one of the problems an Operations team faces as it moves towards the DevOps goals.

Published in: Technology, News & Politics
1 Comment
13 Likes
Statistics
Notes
  • Write a comment...
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
8,675
On Slideshare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
286
Comments
1
Likes
13
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. DevOps & ChefFriday 16 March 12
  2. DevOpsFriday 16 March 12
  3. Devs vs OpsFriday 16 March 12
  4. Devs vs OpsFriday 16 March 12
  5. Devs vs Ops The Wall Of ConfusionFriday 16 March 12
  6. Change vs StabilityFriday 16 March 12
  7. A Meeting of Minds Follow code into the wild Accept change: become agileFriday 16 March 12
  8. Buzzword: DevOpsFriday 16 March 12
  9. Buzzword: DevOps Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword BuzzwordFriday 16 March 12
  10. Buzzword: DevOps Buzzword Buzzword Buzzword Buzz Lightyear Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword BuzzwordFriday 16 March 12
  11. Buzzword DevOps Buzzword: Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Lightyear Buzzword Buzz Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzz Aldrin Buzzword Buzzword BuzzwordFriday 16 March 12
  12. What is DevOps?Friday 16 March 12
  13. What is DevOps? What is DevOps NOT?Friday 16 March 12
  14. What is DevOps? They are making a play for our jobs What is DevOps NOT?Friday 16 March 12
  15. Devs want root What is DevOps? They are making a play for our jobs What is DevOps NOT?Friday 16 March 12
  16. DevOps is not a job title, it’s a philosophy Devs want root What is DevOps? They are making a play for our jobs What is DevOps NOT?Friday 16 March 12
  17. DevOps is not a job title, it’s a philosophy Devs want root What is DevOps? They are making a play for our jobs What is DevOps NOT? So many wordsFriday 16 March 12
  18. DevOps, for meFriday 16 March 12
  19. DevOps, for me: TestingFriday 16 March 12
  20. DevOps, for me: Testing MonitoringFriday 16 March 12
  21. DevOps, for me: Testing Monitoring AutomationFriday 16 March 12
  22. DevOps, for me: Testing Monitoring AutomationFriday 16 March 12
  23. DevOps, for me: Testing Don’t release broken things Monitoring Know when things break Automation Replace/fix broken things instantlyFriday 16 March 12
  24. ✔ ?Friday 16 March 12
  25. SCCS: Source Code Control SystemFriday 16 March 12
  26. SCCS: Source Code Control System 1972 40 Years Ago!Friday 16 March 12
  27. Revision Control ✔Friday 16 March 12
  28. Revision Control Test Driven Development ✔Friday 16 March 12
  29. Revision Control Test Driven Development Feature Branches ✔Friday 16 March 12
  30. Revision Control Test Driven Development Feature Branches Continuous Integration ✔Friday 16 March 12
  31. Revision Control Test Driven Development Feature Branches Continuous Integration Staging Environments ✔Friday 16 March 12
  32. Revision Control Test Driven Development Feature Branches Continuous Integration Staging Environments AGILE ✔Friday 16 March 12
  33. AGILEFriday 16 March 12
  34. AGILE OPS ?Friday 16 March 12
  35. AGILE OPS Continuous Deployment ? Feature Flags Dark Launches Automated Recovery IMVU - 50+ Flickr - 10+ Etsy - 25Friday 16 March 12
  36. Instant Feedback Rollbacks Confidence No fear of changeFriday 16 March 12
  37. Code InfrastructureFriday 16 March 12
  38. Infrastructure CodeFriday 16 March 12
  39. Infrastructure As CodeFriday 16 March 12
  40. $  ssh  root@web1 Last  login:  Tue  Mar  13 #  apt-­‐get  install  apache2 ... #  vim  /etc/apache2/sites-­‐enabled/default.conf ... #  /etc/init.d/apache2  restart ... #  scp  web2:/root/.ssh/authorized_keys  ~/.sshFriday 16 March 12
  41. ChefFriday 16 March 12
  42. SERVER chef-client on node use knife to push retrieves config to server configuration from server use knife to query and CLIENT CLIENT ssh to clients (workstation) (server/node)Friday 16 March 12
  43. Chef/nodes/web1.jsonFriday 16 March 12
  44. { "access" : [ "developers", "designers" ], "name": "web1", "run_list": [ "role[base]", "role[web]", "recipe[splunk]" ]}Friday 16 March 12
  45. { "access" : [ "developers", "designers" ], "name": "web1", "run_list": [ "role[base]", "role[web]", "recipe[splunk]" ]}Friday 16 March 12
  46. Chef/nodes/web1.json Chef/roles/web.rbFriday 16 March 12
  47. run_list("recipe[apache]", "role[monitoring]")Friday 16 March 12
  48. run_list("recipe[apache]", "role[monitoring]")Friday 16 March 12
  49. Chef/nodes/web1.json Chef/roles/web.rb Chef/cookbooks/apache/ recipes/default.rbFriday 16 March 12
  50. package "apache2" do action :install endFriday 16 March 12
  51. apache_modules = [wsgi, ssl, auth_tkt, proxy_http, headers, rewrite, status] apache_modules.each do |mod| apache_module mod do enable true notifies :restart, "service[apache2]" end endFriday 16 March 12
  52. apache_modules = [wsgi, ssl, auth_tkt, proxy_http, headers, rewrite, status] apache_modules.each do |mod| apache_module mod do enable true notifies :restart, "service[apache2]" end endFriday 16 March 12
  53. package "apache2" do case node[:platform] when "centos","redhat","fedora","suse" package_name "httpd" when "debian","ubuntu" package_name "apache2-mpm-prefork" end action :install endFriday 16 March 12
  54. package "apache2" do case node[:platform] when "centos","redhat","fedora","suse" package_name "httpd" when "debian","ubuntu" package_name "apache2-mpm-prefork" end action :install endFriday 16 March 12
  55. Chef/nodes/web1.json Chef/roles/web.rb Chef/cookbooks/apache/ recipes/default.rb attributes/default.rbFriday 16 March 12
  56. default[:apache][:version] = "2.2"Friday 16 March 12
  57. package "apache2" do action :install version "#{node[:apache][:version]}" endFriday 16 March 12
  58. Chef/nodes/web1.json Chef/roles/web.rb Chef/cookbooks/apache/ recipes/default.rb attributes/default.rb templates/default/apache2.conf.erbFriday 16 March 12
  59. template "#{node[:apache][:dir]}/apache2.conf" do source "apache2.conf.erb" owner "root" mode 0644 notifies :restart, resources(:service => "apache2") endFriday 16 March 12
  60. It’s all RubyFriday 16 March 12
  61. It’s all Ruby http://wiki.opscode.com/display/chef/Just+Enough+Ruby+for+Chef “Just Enough Ruby for Chef”Friday 16 March 12
  62. It’s all Ruby Let’s hackFriday 16 March 12
  63. Chef/nodes/web1.json Chef/roles/web.rb Chef/cookbooks/apache/ recipes/default.rb attributes/default.rb templates/default/apache2.conf.erb libraries/default.rbFriday 16 March 12
  64. class Chef   class Recipe     def apache_ports(&block)       @node[:apache][:vhosts].each do |vh|        vh[:ports].each do |p|          block.call(p)          end       end     end   end endFriday 16 March 12
  65. apache_ports do |p| firewall_port p do action :open end endFriday 16 March 12
  66. apache_ports do |p| firewall_port p do action :open end endFriday 16 March 12
  67. define :firewall_port, :action => :open do if not params.has_key?(:port) params[:port] = params[:name] end   if params[:action] == :open     execute "open #{params[:port]}" do       command "iptables -A INPUT --destination-port #{params[:port]} -j ACCEPT"     end   else     execute "close #{params[:port]}" do       command "iptables -A INPUT --destination-port #{params[:port]} -j DROP"     end   end endFriday 16 March 12
  68. Providers package "apache2" do action :install end apt-get install yum install node[:platform] brew installFriday 16 March 12
  69. "#{File.expand_path( Chef::Config[:file_cache_path] )}/handlers/yola.rb"Friday 16 March 12
  70. "#{File.expand_path( Chef::Config[:file_cache_path] )}/handlers/yola.rb" class YolaHandler < Chef::Handler def report() run_status.updated_resources.each do |r| campfire_speak(r.to_s) end end endFriday 16 March 12
  71. "#{File.expand_path( Chef::Config[:file_cache_path] )}/handlers/yola.rb" class YolaHandler < Chef::Handler def report() run_status.updated_resources.each do |r| campfire_speak(r.to_s) end end endFriday 16 March 12
  72. Chef/nodes/web1.json Chef/roles/web.rb Chef/cookbooks/apache/ recipes/default.rb attributes/default.rb templates/default/apache2.conf.erb libraries/default.rb Chef/environments/production.rbFriday 16 March 12
  73. Chef/nodes/web1.json Chef/roles/web.rb Chef/cookbooks/apache/ recipes/default.rb attributes/default.rb templates/default/apache2.conf.erb libraries/default.rb Chef/environments/production.rb Chef/environments/testing.rbFriday 16 March 12
  74. default_attributes({ "aws_region" => "usa-east" }) default_attributes({ "aws_region" => "usa-east", "logging" => { "debug" => true } })Friday 16 March 12
  75. Chef/nodes/web1.json Chef/roles/web.rb Chef/cookbooks/apache/ recipes/default.rb attributes/default.rb templates/default/apache2.conf.erb libraries/default.rb Chef/environments/production.rb Chef/environments/testing.rb Chef/data_bags/employees/jonathan.jsonFriday 16 March 12
  76. { "name": "Jonathan Hitchcock", "id": "jonathan", "groups": ["developers", "operations"], "ssh_keys": [ { "key": "AAAB3NzC1yc2EAAAABIwAAAQEA3advEyDE0aEo==" } ] }Friday 16 March 12
  77. ProvisioningFriday 16 March 12
  78. Provisioning $ knife ec2 server create -r role[webserver] -I ami-7000f019 -f m1.smallFriday 16 March 12
  79. Provisioning $ knife ec2 server create -r role[webserver] -I ami-7000f019 -f m1.small Amazon EC2 Openstack Rackspace Cloud libvirt Eucalyptus KVM Kickstart XEN VagrantFriday 16 March 12
  80. Integration configuration data vs configuration logicFriday 16 March 12
  81. Integration configuration vs configuration logic dataFriday 16 March 12
  82. Integration configuration vs configuration logic data Ohai Collects infrastructure data Stored and indexed in NoSQL Search and useFriday 16 March 12
  83. (A side note on) Attributes default normal override automaticFriday 16 March 12
  84. (A side note on) Attributes default cookbooks, data bags normal node definitions override for special cases automatic ohaiFriday 16 March 12
  85. (Back to) Integration search(:node, role:webbackend) do |wb| haproxy_backend "#{wb[:apache][:port]}" do action :create end end Systems auto-discover each other Configuration is responsive to changesFriday 16 March 12
  86. Integration search(:node, role:webbackend) do |wb| haproxy_backend "#{wb[:apache][:port]}" do action :create end end Systems auto-discover each other Configuration is responsive to changes So you don’t have to be!Friday 16 March 12
  87. Jonathan Hitchcock @vhata github.com/vhataFriday 16 March 12

×