Fri, 05 Jun 2009
To Puppet or to Chef, that is the Question
I have taken a break from coding ruby and rails for a couple of weeks to try and get my company’s administration is order. To do this I have been using the sysadmins automation tool called puppet, which is written in ruby, but uses an external DSL, meaning that you don’t get all the power of ruby, just the amount that they let you have. I actually even went to Belgium last week to a training course run by the company responsible for maintaining the puppet code. And while there I came to the conclusion that I like the idea of having an external DSL… in theory. Because it means that it is tailored to the task at hand, and it is actively parsing the code you write to make sure that it adheres to a set of rules for the task. But like I said in theory this is a good idea. In practice, well being a ruby developer means that I find puppet extremely restrictive. Simple things that I take for granted in ruby (in any programming language in fact) are just not available in puppet. Which is very strange to me, as the company claims to have been around for as long as rails and you would think that in the about 4 years that rails have been around puppet would have matured to a much higher level than where they are. In fact in using puppet I always have a feeling that I am using some outdated version of the code because it just does not allow me to do the simplest of things. For example before version 0.24.5 (or something like that) and bearing in mind that they are on 0.24.8 at the moment, you couldn’t even do
if $variable == something_else
Which means that because I am using ubuntu as my server and the version
of puppet that ships with that is older than this, I cannot even do
this. I asked on the irc channel about the best way to install puppet
and they kept telling me to stick with the distributions copy or create a
package for the distribution myself. I am obviously dealing with a
bunch of sysadmins here, they never want anything to stray off the
beaten path. And the thought of installing myself from souce,
nooooooooo, burn him at the stake they cry.
But anyway, I mean come on, for a configuration tool that claims to have
been around for so long this is just poor in my eyes. I start to wonder
that if it is just because the guys that produce puppet just are very
paranoid and just don’t trust people to use the full power of ruby
correctly. And if this is the case, it is kind of an insult and we as
developers (or indeed sysadmins, which is who the tool is primarily
designed for) don’t need to be babied in this way.
Chef on the other hand (which I have no experience with, except for a
lot of reading and research that I have done) seems to embrace the ruby
(and rails) philosophy more. They give you a tool, written with an
internal ruby DSL, meaning that you can do anything that you can do in
ruby when writing the scripts, this means that there is not much momr
learn for us ruby developers, just some new methods, and it has a top
down order of execution, which mean that code is executed in the order
it is written in, which puppet isn’t. I mean, why make things more
complicated than they need to be? Companies systems are complicated
enough, but to then go and invent, what in essence is a whole complex
new language (a feature poor one at that), just to manage those systems
is insanity if you ask me.
But I digress. I will continue to battle the puppet in the coming weeks
and see if I can get it to do what I want. But if it were my choice I
would have gone with Chef, it might not have solved any of the bigger
problems in any a simpler manner that I am having with puppet, but it
would have been a hell of a lot less frustrating to be using a language I
know, with rules that I know, and could debug problems within 5 - 10
mins instead of half a day. Oh and I must add that while there is a lot
of puppet documentation out there, I find it disorganised, and unclear.I
could be reading something and trying to apply it, only to find out
through the irc channel that the way I am doing it is deprecated
or it applies to another version of puppet.
Oh and just on the off chance I was reading an article in Linx-mag.com,
and they just happen to mention both puppet and Chef, which is strange
because system automation isn’t even the topic of the article. But here
it is for you anyway
http://www.linux-mag.com/id/7348/
And here is what Ezra of Engine yard fame has to say on the subject.
http://brainspl.at/articles/2009/01/15/chef-suck-on-my-chocolate-salty-balls
and
http://brainspl.at/articles/2009/01/31/cooking-with-chef-101
I must admit that I have a basis towards Chef because of its pure
rubyness, but then why make life harder than it needs to be. Ruby was
made to bring the fun back into development, and it has spoilt me for
any other languages, and without it I certainly wouldn’t be a developer
anymore. Why? Life is too short. Puppet seems to want to more in the
opposite direction to this.
I have heard it said that ruby developers and stuck up and arrogant
about their language, we have a right to be, it is a language designed
for humans first, not machines.
I seriously don’t understand how so many companies use puppet, but I
guess the mind of a developer (especially a ruby one) is far removed
from that of a sysadmin. Thank God!





