I’m working as a Technical Solution Engineer at Puppet Labs Inc. since four month now. Part of my job is to to demonstrate and convince customers and partners from the value of using Puppet within existing IT environments.
One question i ask myself each day when doing demonstrations is: “How can you describe the value of puppet very simplified so everyone understands it?”
An idea that is in my head now for some month is to describe puppet in a very abstract way. I’m using the example “Puppet builds your dream house” with the following quote from Albert Einstein: “If you can’t explan it simply, you don’t understand it well” to describe the added value of Puppet understandable for everyone.
Suppose, I want to build my dream house. A house is comparable to an IT landscape, a complex construct. Since I have neither studied architecture nor learned any craft, it is difficult or almost impossible for me to build my dream house by myself. But what I can do, and I’m assuming everyone can do, is to describe my dream house. I can start doing this by decompose my house into all the parts of which it consists. To simplify my dream house i break it down into the following components:
– a roof
– 4 walls (front, back , left and right)
– 3 windows (left, right and back)
– 1 door
– fundament
Each of these components can be described in detail any further. eg: my roof should have red brick, glass fiber insulation and the roof construct should be made out of wood. My door should have the color anthracite, has a combination lock as a lock and a letterbox slot, etc.
When using the puppet language each part is a puppet resource. Each resource has 1 to n attributes with values. The construct of the puppet language is always the same when describing a puppet resource. Resource, the name of the resource and 1 to n attributes with their values. The following example shows this construct:
resource { 'name of the resource': attribute 1 => value 1, attribute 2 => value 2, attribute n => value n, }
Because of this easy construct, the puppet language itself is a human readable language. I can start using the language to describe all parts of my house:
roof { 'my roof': colourbricks => 'red', insulation => 'glass fiber', construct => 'wood', } door { 'my entry door': lock => 'combination lock', colour => 'anthracite', letterboxslot => 'yes' } etc.
Wonderful! Now i described all parts of my dream house in puppet language. As next step i have to describe the relations between all the parts. As example a door alone will fall over if it’s not part of a wall. You can do this by using metaparameters that describe the relation between the door and a wall:
wall { 'front': colourinside => 'blue', colouroutside => 'yellow', height => '3 meter', width => '4 meter', } door { 'my entry door': lock => 'combination lock', colour => 'anthracite', letterboxslot => 'yes' require => Wall['front'], }
Bye using the metaparameter require => Wall [‘front’] i defined that first the wall with the name front needs to be constructed before the door with name my entry door can be integrated into the wall. That makes sense, right?
O.k. to describe the whole construction plan of my house i have to describe all parts and the relations between them:
fundament { 'my fundament': material => 'concrete', length => '4 meter', width => '4 meter', } wall { 'front': colourinside => 'blue', colouroutside => 'yellow', height => '3 meter', width => '4 meter', requires => Fundament['my fundament'], } wall { 'back': colourinside => 'blue', colouroutside => 'yellow', height => '3 meter', width => '4 meter', requires => Fundament['my fundament'], } wall { 'left': colourinside => 'blue', colouroutside => 'yellow', height => '3 meter', width => '4 meter', requires => Fundament['my fundament'], } wall { 'right': colourinside => 'blue', colouroutside => 'yellow', height => '3 meter', width => '4 meter', requires => Fundament['my fundament'], } window { 'left': colour => 'yellow', height => '1 meter', width => '1 meter', requires => Wall['left'], } window { 'right': colour => 'yellow', height => '1 meter', width => '1 meter', requires => Wall['right'], } window { 'back': colour => 'yellow', height => '1 meter', width => '1 meter', requires => Wall['back'], } roof {'my roof': colourbricks => 'red', insulation => 'glass fiber', construct => 'wood', requires => Wall['front','back','left','right'], }
Done! Now i got my whole construction plan in Puppet language and also described the relations between all the parts of my dream house.
And that is all you do basically with Puppet. Now Puppet will use the construction plan as desired state for your dream house and translates it into all necessary steps to construct it. After that it will use craftsmen (puppet provider) to build your house. To build my house i need the following craftsman/provider:
– roofers
– window & door fitter
– bricklayer
– painter
Puppet out of the box brings all the necessary craftsmen/providers and can be extended individually with new providers and resources. Bye defining the desired state of my dream house in this declarative way i can also use puppet to describe the desired state of a skyscraper, a ship, an airplane or even a spaceship if there are craftsman/provider available to construct them.
Puppet has many more advantages. By default it checks the desired state of my construction plan with the current state of my dream house every 30 minutes. If for example someone painted my wall with a graffiti (which is a configuration drift in puppet language), puppet will automatically paint my wall back to the desired colour. In my case it will be blue.
As i’m not the only one that would like to build a dream house i will start to make my Puppet code reusable inside a puppet class. Part of my dream house class looks similar to this:
class mydreamhouse { $material => 'concrete', .... fundament { 'my fundament': material => $material, ..... }
Now i can simply put this class into a puppet module, publish it on the puppet repository forge and every dream house builder out there can reuse it by using Puppet to describe and manage their dream houses.
The same concept of defining the desired state of all your IT infrastructure components (users, groups, firewalls, services etc.) can be used to simplify and automate the configuration management of your IT environment.
Yes, i know. This is a very simplified and abstract way to describe the Puppet language and technology. But now everyone should be able to understand how puppet works and how you can/could use it inside your IT