fiddyspence's blog

Raspberry Puppet

I got my Raspberry Pi this week in an unexpected fit of generosity on the part of RS components.  It was particularly nice of them, considering I live in England, to send me what appears to be a French mains adapter on the other hand.  For fear of going off on a tangent, we’ll leave their shortcomings aside.

What was cool however was getting it up and running.  I followed the destructions at the Raspberry Pi quick start guide and fairly quickly had it up and running.  I plugged it into the TV via HDMI, and it booted straight away into a post install config menu.  Not having a USB keyboard I pottered off, found out it’s IP address and SSH’d into it to have a poke about.

The first thing I did was to expand the root filesystem to fill the whole 16GB SD card - the image it comes with, because I slapped it onto the card with dd, doesn’t fill the space.  Reboot.

What now then?

Well, for kicks, I thought I’d try and put Puppet on it - I wondered how it would do on ARM in a resource constrained environment.  I had a Puppet 3 master kicking around the place, so having an agent seemed ideal.

I figured running Puppet from source was going to be the easiest path to enlightenment, so I followed the destructions on the running Puppet from source documentation.  I installed ruby1.9.3 from apt.  I hacked together a basic configuration file, added the user and group and with high hopes kicked off an agent run:

root@raspberrypi:~# puppet agent -t
Info: Creating a new SSL key for raspberrypi.spence.org.uk.local
Info: Caching certificate for ca
Info: Creating a new SSL certificate request for
Info: Certificate Request fingerprint (SHA256):
Exiting; no certificate found and waitforcert is disabled

root@raspberrypi:~# puppet agent -t
Info: Caching certificate for raspberrypi.spence.org.uk.local
Info: Caching certificate_revocation_list for ca
Info: Retrieving plugin
Info: Caching catalog for raspberrypi.spence.org.uk.local
Info: Applying configuration version ‘1349353720’
Finished catalog run in 0.82 seconds
root@raspberrypi:~# puppet –version


Next - will it run a master under webrick…
Before I did this, I modified the memory split of the device to only have 32mb memory for Video, and I turned off the X server too.

root@raspberrypi:/# puppet master


root@raspberrypi:/var/log# puppet agent -t
Info: Retrieving plugin
Info: Caching catalog for raspberrypi.spence.org.uk.local
Info: Applying configuration version ‘1349425180’
this is a test
/Stage[main]//Node[default]/Notify[this is a test]/message: defined ‘message’ as ‘this is a test’
Info: Creating state file /var/lib/puppet/state/state.yaml
Finished catalog run in 0.76 seconds

Hell yeah!

It’s not fast, by any means - I installed stdlib 3.0.1, and re-ran the agent.  Pluginsync took 1 minute 56 seconds to complete running an agent against the box locally….

I’m going to see whether I can get it to scale a bit better, but given memory constraints, adding a webserver and a rack server (initial indications are that it runs OK actually - pluginsync performance is no better really - the limitation appears to be CPU - the box swapped a bit, but to no great extent).

Running another box against it as a puppet master, not that many resources, nothing fancy like an ENC or PuppetDB etc (though I could point myself at a remote one) I was pleasantly surprised to see it actually run pretty fast in terms of catalog compiles (including some templating and stuff) especially as I’m running in debug.

With about 5 file resources, 600 sysctl resources and a notify, and a complex-ish graph (File <| |> -> Sysctl <| |> -> Notify <| |>) a catalog compile takes:

Oct  5 12:18:49 raspberrypi puppet-master[25733]: Compiled catalog for debian-1.spence.org.uk.local in environment production in 28.14 seconds

Compared to a KVM 2.7.12 PE Puppet master, doing the same catalog compile it looks slow:

Oct  5 13:35:50 puppet puppet-master[11989]: Compiled catalog for debian-1.spence.org.uk.local in environment production in 2.12 seconds

but for a $25 appliance with 16GB of storage that can now bootstrap an entire datacenter, I think it’s awesome!