Archive for the ‘Blog’ category

Neat Git Reference

June 14th, 2010

Rather than you having to wade through the Git documentation the nice people at GitHub have produced a neat reference for Git.

Dear America, what happened to G?

June 8th, 2010

First in a series of “America where things are different” posts. This one brought to you by the letter G.

So … in normal countries the bottom floor of any building called Ground or G. You press that button in a lift and you know when the doors open that you’re going to be at the bottom of the building, press 1 for the 1st Floor, 2 for the 2nd Floor, etc. Seems reasonable eh? Well not in America. Get in a lift here and there no G button. None. So yours truly standing in the lift in Macy’s looking at the buttons and wondering how to get to the Ground Floor. In a somewhat tentative experiment I pressed the lowest possible number, 1, and waited to see what happened. A cautious poke of my head out of the lift revealed I was on the Ground Floor. Okay… So why 1? Well it seems the Ground Floor in American the 1st Floor. Weird.

Status of Puppet on Windows

June 6th, 2010

Lots of people are aware that we’re porting to Windows. David Schmitt and Markus are doing all the hard work for it and David has just provided an update on his status.

If you’re interested in helping out checkout his repository on GitHub to see the current efforts and do some testing.

Puppet Module Repository isn’t just for modules

June 1st, 2010

You can store more than just your modules at the Forge. :)   I just added my types and providers to my collection of modules at the new Puppet Module Forge.  I’d love to all those people maintaining types and providers, functions, and facts add theirs to the Forge also.  It’s a cool way to share your (and the site allows you to provide links back to your and ticketing system so user’s can report bugs).  In time I hope most people’s environments will consist of the core types and providers bundled with and a selection of cool generated by the community and sourced from the Forge.

Puppet Forge in beta!

May 27th, 2010

The Forge AKA the Puppet Module Repository live and operational.  It’s a store of modules (and types and providers) that allows you to share your awesome and modules with others.

It also comes with the -module tool that allows you to build modules for, manage and install modules from the forge.  You can install -module via a gem:

$ sudo gem install -module

Both the site and tool are in public beta right now so hammer away at it and tell us what you think!

DevOpsDownUnder – What the Fuck is DevOps?

May 12th, 2010

I’ve put my slides from DevOps DownUnder to Slideshare – What the Fuck is DevOps?.  I think the video got messed up but will post it there if it didn’t.

Introducing Scaffold

May 4th, 2010

I’ve just written and released Scaffold – a very simple scaffolding templating tool. It integrates with to create a variety of configuration and objects.

You can install it via a gem currently:

$ sudo gem install scaffold

It requires and will install the templater gem as a dependency.

You can then use it like so:

* Basic configuration (creates site.pp, fileserver.conf and supporting material in the configuration directory):

$ scaffold

* Modules (it checks the module path and creates the module in the first module path it finds):

$ scaffold module module_name

* Nodes (assumes you’ve created the basic configuration and creates nodes in configuration directory):

$ scaffold node node_name

* Classes and Definitions:

$ scaffold class module_name class_name

$ scaffold define module_name define_name

* Functions:

$ scaffold function module_name function_name function_type

The function can be statement or rvalue and defaults to statement if omitted.

* Types and providers:

$ scaffold module_name type_name

I’d welcome feedback and ideas (and !) on how to extend it. The idea that once we’ve got a strong working tool we’ll look to integrate the result into mainline as a provisioning and templating system.

Puppet type for HTTP Authentication

April 25th, 2010

I have recently found myself writing a lot of HTTP Authentication password files. After looking around at the various solutions for managing these files, I wasn’t overly happy with any of them. So I sat down to try to puzzle out how hard it’d be to manage HTTP password files using a custom .

After exploring the htpasswd and htdigest commands it was clear that it wasn’t going to provide a solution: you can add and delete users from files but you can’t query a HTTP password file to determine if a user already exists in the file. This a bit of a show-stopper with . To determine what state the resource in and hence what action to take needs to be able query whether a configuration item exists or not.

I then had a quick look at some Ruby bindings/API for htpasswd provided by the htauth gem but again wasn’t happy with how it was implemented. I also tend to be unhappy with having to install a gem to allow what should be simple to function.

By chance I remembered that WEBrick supports HTTP Basic and Digest Authentication. I knew the support for authentication actions was there but was pleasantly surprised when I discovered that WEBrick could also manage HTTP password files, including adding and deleting users and importantly for writing a querying them. The guts of this functionality provided with WEBrick::HTTPAuth::Htpasswd and WEBrick::HTTPAuth::Htdigest. Naturally, like much of the rest of WEBrick, there limited documentation and no good examples but it thankfully a very simple interface. So with some trial and error I have come up with a very basic and that performs some of the same actions as the htpasswd and htdigest commands. You can find the resulting Puppet-httpauth code at GitHub or it’s available as a ready to download module at the Forge. It’s pretty basic thus far, for example it only creates and deletes users – it can’t check if you only want to change a password rather than create an entirely new user. I’ll perhaps have time to look at that at a later date.

Yes Mum, still behaving

April 22nd, 2010

In a previous post I talked about using Cucumber and Cucumber-Nagios to do what I crudely called “Behaviour Driven Infrastructure”. In that post I gave you a very brief introduction to Cucumber’s syntax.  This post explores another piece of syntax called outlining that allows you to shortcut some of your testing scenarios.

In the tests we demonstrated you could potentially end up with some quite repetitive scenarios, for example:

  Scenario: Visiting home page
    When I go to http://www.google.com
    Then the request should succeed

If we have multiple websites we can end up with repetitive scenarios like:

  Scenario: Visiting home page
    When I go to http://www.google.com
    Then the request should succeed
  Scenario: Visiting home page
    When I go to http://www.nextsite.com
    Then the request should succeed
  Scenario: Visiting home page
    When I go to http://www.anothersite.com
    Then the request should succeed

We can summarise this series of scenarios with a nifty bit of refactoring using some Gherkin (Cucumber’s DSL) syntax called an Outline.  Using an outline we can create a kind of template like so:

Scenario Outline: Home
  When I go to <url>
  Then the request should succeed
  Examples:
  | url            |
  | http://www.google.com |
  | http://www.nextsite.com |
  | http://www.nextsite.com |

Cucumber turns each example—each table row—into a concrete scenario before looking for matching step definitions.  And hey presto when it runs you get:

$ bin/cucumber --require features/ features/home/outline.feature
Scenario Outline: Home            # features/home/outline2.feature:1
When I go to <url>              # features/steps/webrat_steps.rb:1
Then the request should succeed # features/steps/result_steps.rb:13

Examples:
| url                     |
| http://www.google.com   |
| http://www.nextsite.com |
| http://www.nextsite.com |

3 scenarios (3 passed)
6 steps (6 passed)
0m3.123s

Update – you need cucumber-nagios version 0.7.2 later to use outlines…

Strange things are afoot at the Circle-K

April 12th, 2010

I’m very pleased to announce that I’ve accepted a role at PuppetLabs (formally Reductive Labs) as their Director of Operations (Director of DevOps even? :) ). I’ve had a long association with and the team at Labs and consider them some of the smartest people around.  As a result when I got talking to Luke about coming to work for them I was both excited and terrified.  Excited because I see it as a incredible opportunity to shape a tool, , that I am deeply committed to (or should be committed?  It’s one of those two…) and terrified because it a product that I care about so much and I don’t want to stuff it up. :)

(I may also secretly be a bit terrified because the guys – Luke, Teyo, Scott, Mike, Dan, Rein, Markus, Jesse et al – are “wicked smart” and I am rather hoping they don’t make me feel like an idiot. :P )

My role will involve a wide collection of activities – managing support, helping Luke out with operational and business matters, some customer-facing infrastructure, operations and internal infrastructure, some community and product management working with Michael DeHaan.  I’m going to be around on the mailing list, on IRC, triaging tickets, writing documentation, and even cutting some every now and again.  I’ll also be wrangling the pointy-end of some new things we’re going to be doing in the future.  So somehow it seems just like my “other day job” … except now I get paid. :)