Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DevOps and Chef

DevOps and Chef

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.

Jonathan Hitchcock

March 15, 2012
Tweet

More Decks by Jonathan Hitchcock

Other Decks in Technology

Transcript

  1. A Meeting of Minds Follow code into the wild Accept

    change: become agile Friday 16 March 12
  2. Buzzword Buzzword: DevOps Buzzword Buzzword Buzz Lightyear Buzzword Buzzword Buzzword

    Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Friday 16 March 12
  3. Buzzword Buzzword: DevOps Buzzword Buzzword Buzz Lightyear Buzzword Buzzword Buzzword

    Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzzword Buzz Aldrin Friday 16 March 12
  4. What is DevOps? What is DevOps NOT? They are making

    a play for our jobs Friday 16 March 12
  5. What is DevOps? What is DevOps NOT? They are making

    a play for our jobs Devs want root Friday 16 March 12
  6. What is DevOps? What is DevOps NOT? DevOps is not

    a job title, it’s a philosophy They are making a play for our jobs Devs want root Friday 16 March 12
  7. What is DevOps? What is DevOps NOT? DevOps is not

    a job title, it’s a philosophy They are making a play for our jobs Devs want root So many words Friday 16 March 12
  8. DevOps, for me: Testing Automation Monitoring Don’t release broken things

    Know when things break Replace/fix broken things instantly Friday 16 March 12
  9. AGILE OPS Continuous Deployment Feature Flags Dark Launches Automated Recovery

    IMVU - 50+ Etsy - 25 Flickr - 10+ ? Friday 16 March 12
  10. $  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  ~/.ssh Friday 16 March 12
  11. chef-client on node retrieves configuration from server use knife to

    push config to server use knife to query and ssh to clients SERVER CLIENT (workstation) CLIENT (server/node) Friday 16 March 12
  12. { "access" : [ "developers", "designers" ], "name": "web1", "run_list":

    [ "role[base]", "role[web]", "recipe[splunk]" ] } Friday 16 March 12
  13. { "access" : [ "developers", "designers" ], "name": "web1", "run_list":

    [ "role[base]", "role[web]", "recipe[splunk]" ] } Friday 16 March 12
  14. 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 end Friday 16 March 12
  15. 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 end Friday 16 March 12
  16. 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 end Friday 16 March 12
  17. 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 end Friday 16 March 12
  18. 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 end Friday 16 March 12
  19. { "name": "Jonathan Hitchcock", "id": "jonathan", "groups": ["developers", "operations"], "ssh_keys":

    [ { "key": "AAAB3NzC1yc2EAAAABIwAAAQEA3advEyDE0aEo==" } ] } Friday 16 March 12
  20. Provisioning $ knife ec2 server create -r 'role[webserver]' -I ami-7000f019

    -f m1.small Amazon EC2 Rackspace Cloud Openstack Eucalyptus Kickstart libvirt XEN KVM Vagrant Friday 16 March 12
  21. Integration vs configuration logic Ohai Collects infrastructure data Stored and

    indexed in NoSQL Search and use configuration data Friday 16 March 12
  22. Attributes default normal override automatic cookbooks, data bags node definitions

    for special cases ohai (A side note on) Friday 16 March 12
  23. 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 (Back to) Friday 16 March 12
  24. 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