<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>btm.geek &#187; chef</title>
	<atom:link href="http://blog.loftninjas.org/tag/chef/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.loftninjas.org</link>
	<description></description>
	<lastBuildDate>Mon, 23 Jan 2012 23:12:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>knife, or, my tool is actually a library</title>
		<link>http://blog.loftninjas.org/2009/12/24/knife-or-my-tool-is-actually-a-library/</link>
		<comments>http://blog.loftninjas.org/2009/12/24/knife-or-my-tool-is-actually-a-library/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 21:26:15 +0000</pubDate>
		<dc:creator>btm</dc:creator>
				<category><![CDATA[chef]]></category>
		<category><![CDATA[knife]]></category>

		<guid isPermaLink="false">http://blog.loftninjas.org/?p=447</guid>
		<description><![CDATA[The Chef site starts out with, &#8220;Chef is a systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.&#8221; There is an important point hidden in that description; Chef is not a CM tool. Of course it can be used as one, and many do, but from its beginning it [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://wiki.opscode.com/display/chef/Home">Chef site</a> starts out with, &#8220;Chef is a systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.&#8221; There is an important point hidden in that description; Chef is not a CM tool. Of course it can be used as one, and many do, but from its beginning it has been leveraged by <a href="http://www.opscode.com/adoption">others</a> such as Engine Yard inside of their own infrastructure. You can safely bet it will be an integral part of the <a href="http://www.opscode.com/blog/2009/10/07/preview-chef-0-8-and-the-opscode-platform/">Opscode platform</a> when released as well.</p>
<p>While I was off dealing with my startup&#8217;s acquisition this fall, a chef user <a href="http://gist.github.com/100837">wrote</a> <a href="http://wiki.opscode.com/display/chef/Knife">knife</a>. It was a command line client for interacting with a chef server. An impressively simple prototype, made possible and powered by the chef libraries and API. This has happened before with chef; for instance a while ago in the 0.6 era, an OS X GUI client called <a href="http://github.com/fotonauts/casserole">Casserole</a> was written by another chef user with an itch to scratch. However, something has happened with knife that is interesting enough I&#8217;d like to specifically point out; it got <a href="http://github.com/opscode/chef/blob/master/chef/lib/chef/knife.rb">mainlined</a> and heavily expanded.</p>
<p>This happened for a handful of reasons. For one, it was simply a great idea. The kind of user who would be attracted to chef as a tool is very likely to be a power user who would rather not spend their time clicking around a graphical interface. It&#8217;s much easier to script a command line tool where needed, passing data in and out for quick hacks to your infrastructure. The folks at Opscode saw this, agreed, and set out to add full functionality to it for the upcoming 0.8 release.</p>
<p>What I think is most important is the planning a full API from the start. From hearing <a href="http://twitter.com/adamhjk">Adam</a> talk about other tools being &#8220;first-class citizens&#8221; in chef-land, and knowing his experience writing <a href="http://github.com/adamhjk/iclassify/">iClassify</a> as an early open source <a href="http://reductivelabs.com/trac/puppet/wiki/ExternalNodes">external node</a> tool for <a href="http://reductivelabs.com/products/puppet/">puppet</a>, I know this design was intentional. Using iClassify to tell puppet about your nodes was great, but puppet assumed that you only wanted this tool to classify nodes in the way puppet thought about nodes. Consequentially, when you wanted to to use data in iClassify about your nodes to make decisions about your infrastructure on the fly, you were forced to do it in templates. This created the expected repetition of loading the iClassify library and accessing iClassify in many templates, but also required you at times to do some fancy footwork to get data between templates when you really wanted puppet to know about the data itself.</p>
<p>Reductive Labs recently <a href="http://reductivelabs.com/2009/12/14/a-tour-of-puppet-dashboard-0-1-0/">announced a dashboard for puppet</a>. I was hoping this meant those barriers had been removed. It certainly creates <a href="http://reductivelabs.com/wp-content/uploads/2009/12/Puppet-Dashboard.png">really nice graphs</a> from your <a href="http://reductivelabs.com/trac/puppet/wiki/ReportsAndReporting">puppet report data</a>. However from the <a href="http://github.com/reductivelabs/puppet-dashboard/blob/master/README.markdown">README</a> it looks like you&#8217;re still pushing limited data into puppet using the external node interface. Reductive is going to have to expand this interface greatly if dashboard is to have any meaningful node integration benefits that we didn&#8217;t already have two years ago with iClassify.</p>
<p>Just as you can see some concepts from other configuration management tools in chef, you can <a href="http://wiki.github.com/adamhjk/iclassify/screen-shots">see parts of iClassify</a>. It was a great start and it was disappointing that the puppet community didn&#8217;t engage it further. Perhaps it was simply before its time, but I believe it was that there were too few doors into puppet-land to let you really take advantage of and grow external tools.</p>
<p>I think this was the lesson that Opscode learned, and consequently chef was born with an API. With it we can accomplish nearly anything we dream up. What is most exciting about this is that we can <strong>do whatever everyone else dreams up</strong>. I can&#8217;t wait to see what that is.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.loftninjas.org/2009/12/24/knife-or-my-tool-is-actually-a-library/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Installing Chef 0.8 alpha on Ubuntu Karmic</title>
		<link>http://blog.loftninjas.org/2009/11/24/installing-chef-08-alpha-on-ubuntu-karmic/</link>
		<comments>http://blog.loftninjas.org/2009/11/24/installing-chef-08-alpha-on-ubuntu-karmic/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 10:42:03 +0000</pubDate>
		<dc:creator>btm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chef]]></category>

		<guid isPermaLink="false">http://blog.loftninjas.org/?p=435</guid>
		<description><![CDATA[Theres push to get Chef 0.8 out the door because we&#8217;re all anxious for its awesome list of features and fixes, so we&#8217;re all hunkering down on fixing bugs. Scott Likens has similar notes and theres some more to be found in Dan Deleo&#8217;s 08boot bootstrap recipe. This should help get you going.
On a fresh [...]]]></description>
			<content:encoded><![CDATA[<p>Theres push to get Chef 0.8 out the door because we&#8217;re all anxious for its awesome list of <a href="http://tickets.opscode.com/browse/CHEF/fixforversion/10013">features and fixes</a>, so we&#8217;re all hunkering down on fixing bugs. Scott Likens has <a href="http://likens.us/articles/2009/11/05/down-the-pipe-we-go/">similar notes</a> and theres some more to be found in Dan Deleo&#8217;s <a href="http://github.com/danielsdeleo/cookbooks/blob/08boot/bootstrap/recipes/server.rb">08boot bootstrap recipe</a>. This should help get you going.</p>
<p><strong>On a fresh Ubuntu Karmic install (a VM makes this easy of course):</strong><br />
# Add the Canonical Ubuntu &#8216;multiverse&#8217; repository for Java.<br />
sudo vi /etc/apt/sources.list # add multiverse to your &#8216;deb&#8217; lines if it is not there<br />
sudo apt-get update</p>
<p># Start <a href="http://wiki.opscode.com/display/chef/Bootstrap+Chef+RubyGems+Installation">Chef Gem bootstrap</a> with some notes<br />
# note that I don&#8217;t like to install rubygems from source and use the packages instead. this adds a step or two.<br />
sudo apt-get install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert rubygems git-core -y<br />
sudo gem sources -a http://gems.opscode.com<br />
sudo gem sources -a http://gemcutter.org # for nanite<br />
sudo gem install ohai chef json &#8211;no-ri &#8211;no-rdoc</p>
<p><strong>We now have enough chef to bootstrap ourselves</strong><br />
# Create ~/chef.json:</p>
<pre>{
  "bootstrap": {
    "chef": {
      "url_type": "http",
      "init_style": "runit",
      "path": "/srv/chef",
      "serve_path": "/srv/chef",
      "server_fqdn": "localhost"
    }
  },
  "recipes": "bootstrap::server"
}
# End of file
</pre>
<p># Create ~/solo.rb:</p>
<pre>file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"
# End of file
</pre>
<p>mkdir /tmp/chef-solo<br />
cd /tmp/chef-solo<br />
# Get kallistec&#8217;s 08boot bootstrap cookbook<br />
git clone git://github.com/danielsdeleo/cookbooks.git<br />
cd cookbooks<br />
git checkout 08boot<br />
# Bootstrap chef<br />
sudo /var/lib/gems/1.8/bin/chef-solo -j ~/chef.json -c ~/solo.rb<br />
# If the bootstrap hangs for more than a minute after &#8220;Installing package[couchdb] version 0.10.0-0ubuntu3&#8243; then hit ctrl+c and run again</p>
<p><strong>Now prepare to install the development versions</strong><br />
# install some development tools<br />
sudo apt-get install rake librspec-ruby -y<br />
sudo gem install cucumber merb-core nanite jeweler uuidtools<br />
# install missing dependencies<br />
sudo apt-get install libxml-ruby thin -y<br />
# get chef from the repository<br />
mkdir ~/src<br />
cd ~/src<br />
git clone git://github.com/opscode/chef.git<br />
cd chef<br />
rake install<br />
# remove the old version of chef<br />
sudo gem uninstall chef -v0.7.14<br />
# patch up some runit paths<br />
sudo sed -i s_chef-_/var/lib/gems/1.8/gems/chef-solr-0.8.0/bin/chef-_ /etc/sv/chef-solr*/run<br />
# allow access to futon for development purposes (http://IPADDRESS:5984/_utils)<br />
sudo sed -i &#8217;s/;bind_address = 127.0.0.1/bind_address = 0.0.0.0/&#8217; /etc/couchdb/local.ini<br />
sudo apt-get install psmisc # for killall<br />
sudo /etc/init.d/couchdb stop<br />
sudo killall -15 couchdb # stubborn<br />
sudo killall -15 beam.smp # yup<br />
# shut it all down<br />
sudo /etc/init.d/chef-solr stop<br />
sudo /etc/init.d/chef-solr-indexer stop<br />
sudo /etc/init.d/chef-solr-client stop<br />
sudo /etc/init.d/chef-client stop<br />
sudo /etc/init.d/chef-server stop<br />
sudo killall -15 chef-server</p>
<p><strong>Build some data and start up Chef</strong><br />
# start up the integration environment<br />
cd ~/src/chef<br />
sudo rake dev:features<br />
# this will create a database<br />
# now hit ctrl+c<br />
sudo mv /var/lib/couchdb/0.10.0/chef_integration.couch /var/lib/couchdb/0.10.0/chef.couch<br />
sudo chown couchdb:couchdb /var/lib/couchdb/0.10.0/chef.couch<br />
# start it all up<br />
sudo /etc/init.d/couchdb start<br />
sudo /etc/init.d/rabbitmq-server start<br />
sudo /etc/init.d/chef-solr start<br />
sudo /etc/init.d/chef-solr-indexer start<br />
sudo /etc/init.d/chef-server start</p>
<p><strong>Start the web server</strong><br />
# the web server is now a separate application and uses the API to reach the server<br />
sudo cp /tmp/chef_integration/webui.pem /etc/chef<br />
cd ~/src/chef/chef-server-webui<br />
sudo /var/lib/gems/1.8/bin/slice -p 4002</p>
<p><strong>Using knife</strong><br />
From the user interface you can create a client keypair to use knife from the web interface. I recommend using &#8216;view source&#8217; to copy the private key, and remember to save it without any leading whitespace and run knife like so:</p>
<p>OPSCODE_USER=&#8217;btm&#8217; OPSCODE_KEY=&#8217;/home/btm/btm.key&#8217; /var/lib/gems/1.8/bin/knife</p>
<p>If you can&#8217;t get it to work, you can always use the webui&#8217;s key:</p>
<p>sudo OPSCODE_USER=&#8217;chef-webui&#8217; OPSCODE_KEY=&#8217;/etc/chef/webui.pem&#8217; /var/lib/gems/1.8/bin/knife</p>
<p>Hopefully that is enough to get you going. Jump on #chef on irc.freenode.net or join the <a href="http://lists.opscode.com/sympa/info/chef">chef list</a> if you have any problems. <a href="http://tickets.opscode.com">Tickets/bugs/features</a> are tracked in JIRA, and all sorts of other useful information is in <a href="http://wiki.opscode.com/display/chef/Home">the wiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.loftninjas.org/2009/11/24/installing-chef-08-alpha-on-ubuntu-karmic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using for loops in Chef</title>
		<link>http://blog.loftninjas.org/2009/03/23/using-for-loops-in-chef/</link>
		<comments>http://blog.loftninjas.org/2009/03/23/using-for-loops-in-chef/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 00:28:25 +0000</pubDate>
		<dc:creator>btm</dc:creator>
				<category><![CDATA[Operations]]></category>
		<category><![CDATA[chef]]></category>

		<guid isPermaLink="false">http://labs.widemile.com/?p=44</guid>
		<description><![CDATA[One of the great features of Chef is that you write configurations in Ruby. When wanting to push a number of configuration files out for nagios, I initially turned to the Remote Directory resource. However this could interfere with configuration files created and owned by the debian package, so I needed to be more specific. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the great features of <a href="http://wiki.opscode.com/display/chef/Home">Chef</a> is that you write configurations in Ruby. When wanting to push a number of configuration files out for nagios, I initially turned to the <a href="http://wiki.opscode.com/display/chef/Resources#Resources-RemoteDirectory">Remote Directory</a> resource. However this could interfere with configuration files created and owned by the debian package, so I needed to be more specific. In the past with <a href="http://reductivelabs.com/trac/puppet">Puppet</a> I&#8217;ve had a remote file definition (that uses the <a href="http://reductivelabs.com/trac/puppet/wiki/TypeReference#file">file type</a>) for each configuration file. This works fine, but gets to be repetitive when it doesn&#8217;t need to be. With Chef, you can combine a little ruby with the <a href="http://wiki.opscode.com/display/chef/Resources#Resources-RemoteFile">Remote File</a> resource like so:</p>
<pre class="brush: ruby; title: ; notranslate">
for config in [ &quot;contacts.cfg&quot;, &quot;contactgroups.cfg&quot; ] do
  remote_file &quot;/etc/nagios3/#{config}&quot; do
    source &quot;#{config}&quot;
    owner &quot;root&quot;
    group &quot;root&quot;
    mode 0644
    notifies :restart, resources(:service =&gt; &quot;nagios&quot;), :delayed
  end
end
</pre>
<p>The benefit of this approach is that it makes your configuration management cleaner and more <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY</a>. This is perhaps at the cost of a little complexity, albeit at a degree that I think is pretty easily understood by reading the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.loftninjas.org/2009/03/23/using-for-loops-in-chef/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chef 0.5.2 and Ohai 0.1.4 released</title>
		<link>http://blog.loftninjas.org/2009/02/02/chef-052-and-ohai-014-released/</link>
		<comments>http://blog.loftninjas.org/2009/02/02/chef-052-and-ohai-014-released/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 01:52:45 +0000</pubDate>
		<dc:creator>btm</dc:creator>
				<category><![CDATA[Operations]]></category>
		<category><![CDATA[chef]]></category>
		<category><![CDATA[ohai]]></category>

		<guid isPermaLink="false">http://labs.widemile.com/?p=15</guid>
		<description><![CDATA[We contributed a lot of work to the latest Chef release, which made it out over the weekend. Most notably we got a lot of FreeBSD support in, and it looks like a few people are going to give that shot. The release notes are the best source of information about what was added. As [...]]]></description>
			<content:encoded><![CDATA[<p>We contributed a lot of work to the latest Chef release, which made it out over the weekend. Most notably we got a lot of FreeBSD support in, and it looks like <a href="http://twitter.com/matthewlandauer/status/1165838107">a few people</a> are going to give that shot. The <a href="http://blog.opscode.com/2009/01/chef-052-and-ohai-014.html">release notes</a> are the best source of information about what was added. As we&#8217;re moving puppet recipes over to chef we stumble across pieces of configuration that we&#8217;d rather be a <a href="http://wiki.opscode.com/display/chef/Resources">resource</a>, and try to add that support. We&#8217;re really excited about what we&#8217;re getting into Ohai. I tested support that Ben Black is working on for <a href="http://tickets.opscode.com/browse/OHAI-36">reading libvirt data</a> through their ruby API, and it&#8217;s just going to be awesome. With puppet+iclassify I had some <a href="http://blog.loftninjas.org/2008/10/29/how-i-dealt-with-kvm-host-identification/">convoluted ways</a> of getting guest information, but this implementation is going to be first class enterprise stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.loftninjas.org/2009/02/02/chef-052-and-ohai-014-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building scalable operations infrastructure with OSS</title>
		<link>http://blog.loftninjas.org/2009/01/29/building-scalable-operations-infrastructure-with-oss/</link>
		<comments>http://blog.loftninjas.org/2009/01/29/building-scalable-operations-infrastructure-with-oss/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 02:03:37 +0000</pubDate>
		<dc:creator>btm</dc:creator>
				<category><![CDATA[Operations]]></category>
		<category><![CDATA[chef]]></category>
		<category><![CDATA[configuration management]]></category>

		<guid isPermaLink="false">http://labs.widemile.com/?p=10</guid>
		<description><![CDATA[I&#8217;m the lead systems administrator at Widemile and run operations here. Sometimes I do other things, but operations is most interesting. My linkedin profile may give you an idea of where I&#8217;m coming from, but it misses all those late nights working with OSS because I enjoy it. I usually blog on my own site, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m the lead systems administrator at Widemile and run operations here. Sometimes I do other things, but operations is most interesting. My <a href="http://www.linkedin.com/in/bryanmclellan">linkedin profile</a> may give you an idea of where I&#8217;m coming from, but it misses all those late nights working with OSS because I enjoy it. I usually blog on <a href="http://blog.loftninjas.org/">my own site</a>, but it often serves more as a technical journal than what we are up to at Widemile, which will be the differentiator. As a rule, I&#8217;m not a developer. Certain facts may <a href="http://www.ohloh.net/p/opscode-chef/contributors/1103574666854676">convince you otherwise</a>, but I try to stay out of our product. You&#8217;ll start to hear from <a href="http://www.linkedin.com/in/petercrossley">Peter Crossley</a> , our lead software architect, soon enough. Perhaps some other developers after that. I&#8217;ll christen this blog with a round-up of how we&#8217;re building our infrastructure at Widemile.</p>
<p>Most recently I&#8217;ve been in heavy development on <a href="http://wiki.opscode.com/display/chef/Home">Chef</a> and Ohai. We&#8217;ve been using <a href="http://reductivelabs.com/projects/puppet/">puppet</a> for about a year and a half now. Check out my <a href="http://www.slideshare.net/btm/infrastructure-engineering-presentation">Infrastructure Engineering</a> slide deck for where we were with that a few months ago. I&#8217;ve been happy with it except for a few issues which ended up being mostly major architectural changes to fix. Adam at Opscode has a good post entitled <a href="http://blog.opscode.com/2009/01/9-things-to-like-about-chef.html"><em>9 things to like about Chef</em></a>, that outlines some of these difference. There&#8217;s a lot of e-drama around Opscode&#8217;s decision to write a new product rather than usher changes into puppet. I won&#8217;t touch that other than to say that we had problems with puppet that chef fixes.</p>
<p>Almost all of our servers are in configuration management. Which means that no one-off work is done on the production servers so that all changes are self-documenting. Granted, we&#8217;re a small shop and sometimes I&#8217;ll do minor debugging on a production server, but any changes do end up in CM.</p>
<p>Our servers are almost all kvm guests under libvirt running on Dell blades. There&#8217;s some information about how we got here in a slidedeck I made for <a href="http://www.gslug.org">GSLUG</a> entitled <a href="http://www.slideshare.net/btm/virtual-infrastructure-presentation">Virtual Infrastructure</a>. Apparently using kvm in production isn&#8217;t all that heard of, but since we&#8217;re a small shop we&#8217;re able to leverage new technology very quickly to make the best of it. With the use of <a href="https://launchpad.net/vmbuilder">vmbuilder</a>, <a href="http://libvirt.org/">libvirt</a>, kvm and <a href="http://www.capify.org/">capistrano</a>, we build out new nodes in a matter of minutes. More importantly, it&#8217;s just a couple commands.</p>
<p>Once Chef is intergrated with the libvirt API we expect to be able to further simplify our deployment. The idea behing is that it will be a ghetto version of <a href="http://www.engineyard.com/solo">Solo</a>, which EY built using Chef. Eventually we&#8217;ll pull out capistrano. While it&#8217;s nice for interacting with multiple machines at once, it really was written for a different purpose than <a href="http://www.slideshare.net/btm/capistrano-presentation">what we use it for</a>. There will be replacement functionality in Chef shortly.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.loftninjas.org/2009/01/29/building-scalable-operations-infrastructure-with-oss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning to cook</title>
		<link>http://blog.loftninjas.org/2009/01/26/learning-to-cook/</link>
		<comments>http://blog.loftninjas.org/2009/01/26/learning-to-cook/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 20:27:46 +0000</pubDate>
		<dc:creator>btm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chef]]></category>
		<category><![CDATA[configuration management]]></category>

		<guid isPermaLink="false">http://blog.loftninjas.org/?p=282</guid>
		<description><![CDATA[The chef satire will never die. Adam posted 9 things to like about chef today, which is an expanded and much better version of my original blog post on chef. AJ had an intermediate post that tried to summarize a lot of contraversy and drama. Hopefully that silliness is settling down.
I&#8217;ve been coding a lot [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://wiki.opscode.com/display/chef/Home">chef</a> satire will never die. <a href="http://twitter.com/adamhjk/">Adam</a> posted <a href="http://blog.opscode.com/2009/01/9-things-to-like-about-chef.html"><em>9 things to like about chef</em></a> today, which is an expanded and much better version of my <a href="http://blog.loftninjas.org/2009/01/16/configuration-management-with-chef-announced/">original blog post on chef</a>. <a href="http://twitter.com/fujin_">AJ</a> had an <a href="http://junglist.gen.nz/chef-vs-puppet/">intermediate post</a> that tried to summarize a lot of contraversy and drama. Hopefully that silliness is settling down.</p>
<p>I&#8217;ve been coding a lot lately, contributing to both <a href="http://github.com/opscode/chef">chef</a> and <a href="http://github.com/opscode/ohai">ohai</a>. We&#8217;ve been talking about trying to use chef in the <a href="http://www.shmoocon.org/labs.html">NOC</a> at <a href="http://www.shmoocon.org/">Shmoocon</a> so that next year we can reuse the recipes rather than build the servers again by hand. Most everything runs on borrowed hardware at Shmoocon, so you&#8217;re not guaranteed everything is the way you left it a year later. We use FreeBSD for some monitoring at Shmoocon, so I&#8217;ve been spending a lot of time getting <a href="http://wiki.opscode.com/display/chef/Installation+on+FreeBSD+7.1">chef/ohai ready for FreeBSD</a>.</p>
<p>I don&#8217;t think I&#8217;ve ever contributed to a project to this degree before. <a href="https://www.ohloh.net/accounts/btm">Ohloh</a> doesn&#8217;t think so either. The last time I can recall really adding code to a project that was more than a couple files was at an ISP in Maine back in the early 00&#8217;s. It was called <a href="http://www.panax.com/">Panax</a>, and there&#8217;s the usual pile of silly isp shop history. It&#8217;s funny that while it&#8217;s been sucked into an ISP conglomerate the old color scheme has been maintained. We had an in-house system for user/account management, written in Perl. It had a web front end so none of the tech support folks had to log in to any of the systems to add, remove or manage users. Usually I&#8217;m just writing <a href="http://blog.loftninjas.org/2009/01/26/replacing-munin-with-ganglia/">glue scripts</a>, like a good SA. Regardless, it&#8217;s been fun and I&#8217;ve been learning a lot about Ruby and <a href="http://rspec.info/">rspec</a>.</p>
<p>An <a href="http://www.linkedin.com/pub/1/7ab/7b8">SE at my last job</a> (who subscribes to python and I still haven&#8217;t convinced that CM will change his live) said going into development would be a natural move as I got bored of SA work. Is it that, or is this a shift in being an SA will mean? Configuration Management is still young, despite <a href="http://www.cfengine.org/">cfengine</a> being out for some time now, and <a href="http://reductivelabs.com/projects/puppet/">puppet</a> getting a good following. It may take time for <a href="http://www.dilbert.com/strips/comic/1995-06-24/">the old SAs</a> to retire and the <em>new deal</em> to take hold. I think more and more as people work in shops with CM implemented, they&#8217;ll start to find how hard it is to live without it once you&#8217;ve had it. I noticed recently that <a href="http://www.google.com/search?q=site%3Aslashdot.org+">Slashdot lacks any coverage on Configuration Management</a> in the last few years, but I realize Slashdot is mostly fluffy news these days. While Slashdot is still talking about SCO every day, there is of course <a href="http://search.twitter.com/search?q=%23chef">talk of new technologies</a> in the <a href="http://twitter.com">new mediums</a>.</p>
<p>The next few months will be exciting to see people pick up chef. There&#8217;s a few very helpful individuals in #chef on <a href="http://freenode.net/">freenode</a> who want to see this used and are perfectly willing to fix any bugs you find. So give it a shot and let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.loftninjas.org/2009/01/26/learning-to-cook/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>configuration management with chef announced</title>
		<link>http://blog.loftninjas.org/2009/01/16/configuration-management-with-chef-announced/</link>
		<comments>http://blog.loftninjas.org/2009/01/16/configuration-management-with-chef-announced/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 21:58:49 +0000</pubDate>
		<dc:creator>btm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chef]]></category>
		<category><![CDATA[configuration management]]></category>
		<category><![CDATA[puppet]]></category>

		<guid isPermaLink="false">http://blog.loftninjas.org/?p=281</guid>
		<description><![CDATA[Chef has been announced. Listen to this podcast at Cloud Cafe. There&#8217;s no way around comparing puppet and chef. Sure, they&#8217;re both configuration management tools. It&#8217;s simplest to put it this way:
We&#8217;re replacing puppet with chef.
And why? A little while ago I wrote about problems I&#8217;ve been having scaling puppet. Off the top of my [...]]]></description>
			<content:encoded><![CDATA[<p>Chef has been <a href="http://blog.opscode.com/2009/01/announcing-chef.html">announced</a>. Listen to this <a href="http://www.johnmwillis.com/configuration/cloud-cafe-31-opscode-introduces-chef/">podcast at Cloud Cafe</a>. There&#8217;s no way around comparing puppet and chef. Sure, they&#8217;re both configuration management tools. It&#8217;s simplest to put it this way:</p>
<p>We&#8217;re replacing puppet with chef.</p>
<p>And why? A little while ago I wrote about problems I&#8217;ve been having <a href="http://blog.loftninjas.org/2008/09/18/how-big-is-puppets-envelope/">scaling puppet</a>. Off the top of my head, the biggest issues for me working with puppet have been:</p>
<ol>
<li>Dependencies graphs</li>
<li>Limited capabilities of the language (DSL)</li>
<li>Templates are evaluated on the server</li>
</ol>
<p><strong>Dependency Graphs</strong></p>
<p>There&#8217;s a talk about <a href="http://metainfrastructure.net/trac/puppet/wiki/PuppetScalability">vertically scaling puppet</a>, but not a lot of it about <a href="http://blog.loftninjas.org/2008/09/18/how-big-is-puppets-envelope/">horizontally scaling</a>. I tend to run everything under puppet. People argue that it&#8217;s too much work to put single servers in puppet, and you should only use it for systems you intend to clone. I disagree. Puppet recipe&#8217;s are self documenting. The same people who don&#8217;t want to take the time to write puppet recipes for the single services are the people you have to beat with a <a href="http://linux.die.net/man/8/syslogd">sucker rod</a> to get to document anything. Sometimes if I don&#8217;t have the time to put into fully testing a puppet recipe for a new machine, I&#8217;ll at least write the recipe as I&#8217;m working to server both as documentation and a starting point for if/when I come back to it.</p>
<p>The point is that as I scale out in this fashion, more often puppet will fail with a dependency problem on one run, and be fine on the next.  I asked Luke about this at a BoF at OSCON 2008, and he basically told me that he really only focuses on the problems his paid customers have and was anxious to leave and get a beer. That&#8217;s fine, I understand it, but since it does nothing to fix my problem it drove me away from the puppet community.</p>
<p>While in theory having puppet do all this work to resolve depency issues seems fine, it is more complexity and trouble than it is worth. As a systems administrator I know what the dependancies are. As you build a system you simply write your recipe in the same order as the steps you&#8217;re taking.</p>
<p>Chef takes this idea and runs with it. Recipes are parsed top to bottom. If a package needs to be installed before a service is started, you simply put the package in the recipe first. This not only makes a lot of sense, it makes depencies in a complex recipe visually understandable. With puppet you can end up with spaghetti code remincisent of &#8220;goto&#8221;, jumping around a number of recipes in an order that&#8217;s difficult to understand.</p>
<p><strong>Language</strong></p>
<p><a href="http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#if-else">Before the recent 0.24.6</a>, you could not even do:</p>
<pre>if $ram &gt; 1024 {
    $maxclient = 500
}</pre>
<p>The support for conditionals was rudimentary. I run into a lot of languages and the biggest problem I have is remembering how to do the same thing in each language. The puppet language does not do what a lot of lot of other languages do. I didn&#8217;t need another language to learn, let alone one written from scratch. It was just silly doing something like:</p>
<pre>  # iclassify script addes vmware-guest tag based on facter facts
  $is_vmware = tagged('vmware-guest')
  if $is_vmware {
    include vmware
  }</pre>
<p>Chef uses ruby for it&#8217;s recipes. This makes the above stupidly simple with something like:</p>
<pre>include_recipe "vmware" if node[:manufacturer] =~ /VMware/</pre>
<p><strong>Templates</strong><br />
Puppet evaluates recipes and templates on the server. I ended up with this block of code once when I need to specify the client node&#8217;s IP Address in a configuration file:</p>
<pre class="brush: ruby; title: ; notranslate">
require '/srv/icagent/lib/iclassify'
ic = IClassify::Client.new(&quot;https://iclassify&quot;, iclassify_user, iclassify_password)
query = [ &quot;hostname:&quot;, hostname].to_s
mip = nil
nodes = ic.search(query)
nodes.each do |node|
  # node.attribs is an array of hashes. keys is 'name' value is 'values'
  node.attribs.each do |attrib|
    if attrib[:name].match(/ipaddress/)
      ip = attrib[:values].to_s
      if ip.match(/10.0.0./)
        mip = ip
        break
      elsif ip.match(/10.0.1./)
        mip = ip
        break
      end
    end
  end
end
</pre>
<p>This was so much work. Of course with chef you can easily get this information in the recipe because it&#8217;s parsed on the node, let alone the ease of doing it in the template if that&#8217;s more appropriate. Since the template&#8217;s parsed on the client, you grab the information out of variables or directly from the system.</p>
<p>As time goes on I&#8217;ll surely write more about using chef. We&#8217;re using it production now, and happy with it. In the interim, come to #chef on freenode if you have any questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.loftninjas.org/2009/01/16/configuration-management-with-chef-announced/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

