Archive for April, 2011

PuppetCamp 2011 Amsterdam Talk

by Oliver on Friday, April 29th, 2011.

If you made it to my talk, I hope you enjoyed it. If not, then maybe next time! Either way, I’ve uploaded my slides which are available here.

If I forgot your name, your face, or just totally forgot who you are I apologise, and similarly if I didn’t introduce myself when I was standing right next to you – I’m a terribly shy person at heart so I probably didn’t have the guts to interrupt your conversation to shake your hand. See you next time or on the mailing lists / IRC 🙂

Tags: , , ,

Friday, April 29th, 2011 Tech 1 Comment

Puppet Dev Training / Camp @ Amsterdam

by Oliver on Monday, April 25th, 2011.

I’m currently at the Puppet Developer course at Beurs van Berlage in Amsterdam. We drove up on Friday from Berlin (which should have taken 6 hours, but due to traffic jams and sanity stops it took almost 11 hours). We’ve now spent the weekend exploring Amsterdam, which is an amazing looking city. The canals are breathtaking, and despite the frenzied bicycles and scooters constantly whizzing past it seems to have a relaxed atmosphere. It is like the vibe on Berlin’s Spree river, but several magnitudes of relaxation higher due to there being so many more waterways.

Three days of training and two days of Puppet Camp… and hopefully some more time for exploring and fun. If you are coming to Puppet Camp, see you there!

Tags: , , ,

Monday, April 25th, 2011 Tech No Comments

Did you know…

by Oliver on Thursday, April 7th, 2011.

that if you pass a Ruby symbol through the Puppet external node classifier interface, through a parametrised class and into an ERB template, it will arrive (relatively) unscathed? OK not really, but the special undef Puppet symbol does.

ENC says:
myvariable: :undef

Puppet interprets it as a standard undef (which is internally represented as Puppet::Parser::AST::Undef).

When passed through to an ERB template, it again arrives as the symbol form :undef, which means you can do things like

<% if proxy_host != :undef -%>
proxyhost=<%= proxy_host %>
proxyport=<%= proxy_port %>
<% end -%>

This does bring up an interesting conundrum about variable usage in templates. When you are faced with the pattern of “check some variable, and if the condition is true, enable a whole block of text which involves substitution”, what is the best way to express it? There are a few options:

  1. Reuse one of the substitution variables by testing that it is not an empty string. Requires the parameter in the class to default to empty string.
  2. As above, but default to undef in the class, and test for :undef (as I have done above).
  3. As above, but default to false in the class, and test for false.
  4. Use string values of ‘true’ and ‘false’ for configurations that also require enablers to be explicit before providing parameters in that section
  5. Use a special “enabler” variable to enable the entire block, but this variable is ultimately useless for substitution in other ways.

One of my gripes with the Puppet DSL (and let’s face it, who doesn’t have at least one) is that the type system is inherently different to Ruby’s. While there is the undef “value”, it doesn’t behave like the Ruby nil. Empty strings evaluate as false in Puppet; in Ruby they evaluate as true. It is not permissible to pass undef to a class or definition that wasn’t already set up with a default value. This clearly contrasts with Ruby where nil is a perfectly permissible value to supply (and evaluates as false).

My problems with the above patterns are as follows:

  1. I don’t like that an empty string has some kind of semantic value. I may not want to imply anything about the absence of a value, like an empty string (if for example I’m passing in booleans or numbers).
  2. Passing and testing for :undef is really ugly and totally blurs the Puppet/Ruby border. It is not clear how :undef is handled inside of Puppet to the outside observer.
  3. Again, false has semantic value. I don’t want something to be boolean if I’m passing a string or a number. Why not just use ” when handling string values and false when handling booleans? It destroys your consistency (especially when in Ruby you could just test for “if X != nil” or just “unless X”).
  4. This leads to confusion between real boolean values and the string versions. On the other hand you could use something like <%= proxy_enabler : 'true' ? 'false' %> but this seems even more confusing, even if you understand the ternary operator.
  5. This just seems wasteful. Especially when your class interfaces can consist of 20 or more variables, another one is not welcome. Incidentally, bring on class parameter hashes!

This shows just some of the madness I have to endure day to day. I’d love to know your thoughts on this, as I still haven’t really made my mind up. I did actually request nil to be added to the Puppet language but my ideas on how best this can be applied is still floating about in the wind.

Tags: , ,

Thursday, April 7th, 2011 Tech, Thoughts No Comments

SysAdmin rant of the day

by Oliver on Monday, April 4th, 2011.

It never fails to shock me that it is 2011 and yet there is so much bad software still out there, and still being created. It seems like the most basic elements of a good piece of software are the hardest to come by – like init scripts. I’ve been playing with ActiveMQ today as my team is getting MCollective training (yes, we are the first ones in the world to get trained up on the official course).

I’m shocked to see that configuring it to run as a unix service is performed so shoddily. Admittedly, making the Oracle init script actually work was a far more challenging task but given ActiveMQ is Java and hence “Enterprise” software, is it too much to ask that they put a bit of effort into the basic things like, you know, actually running the software?

Seriously. 🙁

Tags: , , ,

Monday, April 4th, 2011 Tech 6 Comments

Presenting at Puppet Camp 2011 Amsterdam!

by Oliver on Sunday, April 3rd, 2011.

I’m giving another talk at Puppet Camp in Amsterdam, which incidentally will also be a totally awesome event. If you have not already signed up, and you are able to weasel your way into getting management approval then please try to get to it!

I’ll also be attending the Puppet Dev course in the preceding days, which I’m looking forward to immensely. The whole family is driving up (well, I’ll be doing the driving) which should be fun and we’ll get to spend about 10 days there in total. Spring is now really here so it should be amazing weather and hopefully a scenic and enjoyable drive and stay in Amsterdam!


Tags: , ,

Sunday, April 3rd, 2011 Tech No Comments