{"id":1592,"date":"2010-07-14T00:10:08","date_gmt":"2010-07-13T23:10:08","guid":{"rendered":"http:\/\/www.devco.net\/?p=1592"},"modified":"2010-08-17T12:01:55","modified_gmt":"2010-08-17T11:01:55","slug":"bootstrapping_puppet_on_ec2_with_mcollective","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2010\/07\/14\/bootstrapping_puppet_on_ec2_with_mcollective.php","title":{"rendered":"Bootstrapping Puppet on EC2 with MCollective"},"content":{"rendered":"
The problem of getting EC2 images to do what you want is quite significant, mostly I find the whole thing a bit flakey and with too many moving parts. <\/p>\n
These are significant problems and just a tip of the ice berg. All of the traditional aspects of infrastructure management – like Asset Management, Monitoring, Procurement – are totally useless in the face of the cloud.<\/p>\n
A lot of work is being done in this space by tools like Pool Party, Fog, Opscode and many other players like the countless companies launching control panels, clouds overlaying other clouds and so forth. As a keen believer in Open Source many of these options are not appealing.<\/p>\n
I want to focus on the 2nd step above here today and show how I pulled together a number of my Open Source projects to automate that. I built a generic provisioner that hopefully is expandable and usable in your own environments. The provisioner deals with all the interactions between Puppet on nodes, the Puppet Master, the Puppet CA and the administrators.<\/p>\n
<rant> Sadly the activity in the Puppet space is a bit lacking in the area of making it really easy to get going on a cloud. There are suggestions on the level of monitoring syslog files from a cronjob and signing certificates based on that. Really. It’s a pretty sad state of affairs when that’s the state of the art.<\/p>\n
Compare the ease of using Chef’s Knife<\/a> with a lot of the suggestions currently out there for using Puppet in EC2 like these: 1<\/a>, 2<\/a>, 3<\/a> and 4<\/a>.<\/p>\n Not trying to have a general Puppet Bashing session here but I think it’s quite defining of the 2 user bases that Cloud readiness is such an after thought so far in Puppet and its community. <\/rant><\/p>\n My basic needs are that instances all start in the same state, I just want 1 base AMI that I massage into the desired final state. Most of this work has to be done by Puppet so it’s repeatable. Driving this process will be done by MCollective.<\/p>\n I bootstrap the EC2 instances using my EC2 Bootstrap Helper<\/a> and I use that to install MCollective with just a provision<\/em> agent. It configures it and hook it into my collective.<\/p>\n From there I have the following steps that need to be done:<\/p>\n This is a lot of work to be done on every node. And more importantly it’s a task that involves many other nodes like puppet masters, notifiers and so forth. It has to adapt dynamically to your environment and not need reconfiguring when you get new Puppet Masters. It has to deal with new data centers, regions and countries without needing any configuration or even a restart. It has to happen automatically without any user interaction so that your auto scaling infrastructure can take care of booting new instances even while you sleep.<\/p>\n The provisioning system I wrote does just this. It follows the above logic for any new node and is configurable for which facts to use to pick a master and how to notify you of new systems. It adapts automatically to your ever changing environments thanks to discovery of resources. The actions to perform on the node are easily pluggable by just creating an agent that complies to the published DDL<\/a> like the sample agent<\/a>.<\/p>\n You can see it in action in the video below. I am using Amazon’s console to start the instance, you’d absolutely want to automate that for your needs. You can also see it direct on blip.tv here<\/a>. For best effect – and to be able to read the text – please fullscreen.<\/p>\n\n