<?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; puppet</title>
	<atom:link href="http://blog.loftninjas.org/tag/puppet/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>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>

