CONFIGURATION
MANAGEMENT WITH CHEF
   Wednesday, November 16th, 2011
          Charles Johnson
WHO’S THIS GUY?

• Systems   Engineer

• Operations   Junkie

• Currently managing hundreds of nodes across multiple data
 centers, cloud providers, and projects with Chef

• Not   a Rubyist

• @mr_chip
SYSTEMS IS A HARD PROBLEM.

• Provisioning!     • Tools!

• Authentication!   • Mail!

• Monitoring!       • SSH     Keys!

• Security!         • Quality Assurance!

• Networking!       • Users!

                    • Neckbeards!
SYSTEMS IS A PROBLEM THAT
   DOESN’T STAY SOLVED.
• OS vendors and applications are constantly patching. VM
 Templates / snapshots / AMI images / shell scripts are out of
 date as soon as they’re created.

• Errors
       are duplicated by copying & pasting running virtual
 machines.

• Horizontal   scaling introduces heterogenous clusters.

• Noversioning, unit testing, build automation, or release
 controls.
SO MANY CHOICES
SO MANY CHOICES
                 Ubuntu
        Zenoss sftp
                  resolv.conf
                           Rackspacemysql
   Apache       zmq
chroot Sudo emacs monit i386
     membase            PECL
      Sendmailapt  AMI DNS Jetty   samba
  PEAR nfsCentOS Debiansyslog
        mongodb         Ruby          hbase
                              SOLR
    fdisk IIS bluepill VMWare Windows
           iptables VPN
      runit rabitmq init PHP-FPM
  x86_64 Gems Postfix Python /dev/sda
           smb
    ldap screen selinux      yum Munin    god vi
                          Tomcat
      splunk Terramarkupstart afp PHP    git
   lvm nginx   Redhat            AppArmor
    eth0 Amazon     memcached
     lighttpd Perl ufw        /etc/hosts
                            bash     nagios
            zookeeper       svn
                      Openstack
          tmux          riak Passenger
THERE HAS TO BE A BETTER
         WAY.
CONFIGURATION
 MANAGEMENT
SPECIFICALLY, CHEF.
• Manage  your servers by
 writing code, not by running
 commands.

• Integratetightly with your
 applications, databases,
 LDAP directories, and more.

• Automatically Configure
 infrastructure-aware
 applications
EVERYTHING IS CODE.

• Instance   Provisioning      • code

• User   administration        • code

• Database    installation     • code

• Application   Installation   • code

• Services   Configuration      • code

• Networking                   • code
INFRASTRUCTURE AS CODE


• Testable

• Versioned

• Repeatable

• Scalable
GETTING STARTED WITH
               CHEF
• Chef      is inherently client-server

• Weak   Server / Strong Client - Server provides repository and
  security, client interprets and executes policy

• Hosted: Manage        5 nodes free - Opscode.com

• Install   your own Chef Server via gem or apt

• Chef  is Ruby. Drop Ruby blocks into your recipes and they’ll
  just work.
INTERFACING WITH CHEF
• knife   - Chef command-line
 tool

• shef    - Like irb for Chef.

• Cookbooks-
 Cookbooks.opscode.com

• Repo     - Github / SVN

• WebUI -
 manage.opscode.com
WHAT YOU’LL NEED

• Hosted   Chef Account - http://manage.opsource.com

• Cloud   Provider account - AWS / Rackspace

• Github   account or other repo

• Configured    Chef Workstation (gem install chef)

• Some    cookbooks - http://cookbooks.opscode.com
CHEF CORE CONCEPTS

• chef-server      • attributes

• chef    repo     • recipes

• clients          • cookbooks

• nodes            • providers

• environments     • definitions

• roles
DEMO TIME
Provision, Configure, and build
  a full Ubuntu server with
firewall, user accounts, LAMP
   stack, and Wordpress at
Amazon in (about) 5 minutes.

Chef meetup presentation

  • 1.
    CONFIGURATION MANAGEMENT WITH CHEF Wednesday, November 16th, 2011 Charles Johnson
  • 2.
    WHO’S THIS GUY? •Systems Engineer • Operations Junkie • Currently managing hundreds of nodes across multiple data centers, cloud providers, and projects with Chef • Not a Rubyist • @mr_chip
  • 3.
    SYSTEMS IS AHARD PROBLEM. • Provisioning! • Tools! • Authentication! • Mail! • Monitoring! • SSH Keys! • Security! • Quality Assurance! • Networking! • Users! • Neckbeards!
  • 4.
    SYSTEMS IS APROBLEM THAT DOESN’T STAY SOLVED. • OS vendors and applications are constantly patching. VM Templates / snapshots / AMI images / shell scripts are out of date as soon as they’re created. • Errors are duplicated by copying & pasting running virtual machines. • Horizontal scaling introduces heterogenous clusters. • Noversioning, unit testing, build automation, or release controls.
  • 5.
  • 6.
    SO MANY CHOICES Ubuntu Zenoss sftp resolv.conf Rackspacemysql Apache zmq chroot Sudo emacs monit i386 membase PECL Sendmailapt AMI DNS Jetty samba PEAR nfsCentOS Debiansyslog mongodb Ruby hbase SOLR fdisk IIS bluepill VMWare Windows iptables VPN runit rabitmq init PHP-FPM x86_64 Gems Postfix Python /dev/sda smb ldap screen selinux yum Munin god vi Tomcat splunk Terramarkupstart afp PHP git lvm nginx Redhat AppArmor eth0 Amazon memcached lighttpd Perl ufw /etc/hosts bash nagios zookeeper svn Openstack tmux riak Passenger
  • 12.
    THERE HAS TOBE A BETTER WAY.
  • 13.
  • 14.
    SPECIFICALLY, CHEF. • Manage your servers by writing code, not by running commands. • Integratetightly with your applications, databases, LDAP directories, and more. • Automatically Configure infrastructure-aware applications
  • 15.
    EVERYTHING IS CODE. •Instance Provisioning • code • User administration • code • Database installation • code • Application Installation • code • Services Configuration • code • Networking • code
  • 16.
    INFRASTRUCTURE AS CODE •Testable • Versioned • Repeatable • Scalable
  • 17.
    GETTING STARTED WITH CHEF • Chef is inherently client-server • Weak Server / Strong Client - Server provides repository and security, client interprets and executes policy • Hosted: Manage 5 nodes free - Opscode.com • Install your own Chef Server via gem or apt • Chef is Ruby. Drop Ruby blocks into your recipes and they’ll just work.
  • 18.
    INTERFACING WITH CHEF •knife - Chef command-line tool • shef - Like irb for Chef. • Cookbooks- Cookbooks.opscode.com • Repo - Github / SVN • WebUI - manage.opscode.com
  • 19.
    WHAT YOU’LL NEED •Hosted Chef Account - http://manage.opsource.com • Cloud Provider account - AWS / Rackspace • Github account or other repo • Configured Chef Workstation (gem install chef) • Some cookbooks - http://cookbooks.opscode.com
  • 20.
    CHEF CORE CONCEPTS •chef-server • attributes • chef repo • recipes • clients • cookbooks • nodes • providers • environments • definitions • roles
  • 21.
    DEMO TIME Provision, Configure,and build a full Ubuntu server with firewall, user accounts, LAMP stack, and Wordpress at Amazon in (about) 5 minutes.