homebloggeppetto a puppet ide

Geppetto: A Puppet IDE

UPDATE: We released a new version of Geppetto. Please see our Geppetto docs for the latest information.
So in the last few weeks I’ve switched my Puppet development workflow to use Geppetto as an IDE for developing Puppet content. Geppetto has been around for quite some time, however Cloudsmith recently announced the launch of 1.0.0 of this product. Since I was hearing so many good things about it, I thought I would give it a try. The installation was quite straightforward. If you have an existing Eclipse (you can get one from http://www.eclipse.org/helios/), its easy to load up Geppetto within it: Once you have this up and running, it's easy to create a new Puppet module project:
  • File —> New
  • Puppet —> Puppet Project
  • Type in a name of the project “puppet-motd”

You are immediately prompted with a form to fill out. It actually is a graphical front-end to the Modulefile which is required for publishing modules to the Forge. This makes it much easier to ensure you have all the necessary fields, and you can add other module dependencies if needed. By default, Geppetto sets up a sample module layout which tries to cater for all kinds of development: Class based, defined resources, or Ruby based resources: An initial class should have already been created for you. If you navigate to manifests —> init.pp and open the file, you will see some initial scaffolding and comment area. So let's create some basic content:

file { “/etc/motd”:
  content => “Welcome to my box!”,
file { “/etc/issue”:
  content => “Got an issue? Here’s a tissue!”,
Using similar Eclipse concepts that you get from developing in other IDEs, you can see an outline in the bottom left corner now that reflects all of your resource types: You’ll notice that syntax highlighting is available. It also picks up on syntax errors. Lets try creating some content that is invalid. If we add this to the class:
invalid_resource { “invalid!”: }
The resource will be highlighted, and a hover over the errors will give you a clue as to what is wrong. Not only that, you can see in the Project Explorer that a file has an error: These syntax highlighting features stop you from having to constantly check your code for very simple syntax errors all the time. Certainly useful for new Puppet developers. So because the technology is based on the Eclipse IDE, you can also benefit from all the other modules that the Eclipse community has to offer. Want GIT? Use the EGit plugin. Want SVN integration? Use Subclipse. And if you really want to you can have task tracker integration with Mylyn, which talks to all the major issue trackers (Jira, Bugzilla, Redmine, Github etc.). Here is an example Mylyn window showing all our module Github issues from Puppetlabs: For me, I really like the fact I can mix my Ruby development toolkit with my Puppet development toolkit. There is a nice plugin available from the DLTK update site which provides Ruby IDE capabilities: Now I can mix my Ruby development with Puppet allowing me to author Ruby based providers along side of Puppet manifests: So far I’ve found developing large amounts of Puppet content in Geppetto to be quite a nice experience and it certainly fits with my work flow. I would recommend it to new beginners especially, but I believe even grizzled Puppeteers can benefit from the IDE in the long run. Certainly I see a benefit in adapting the work flow for a team of many Puppeteers to include Geppetto as a core development tool. If you have some time I recommend giving it a try. You can either following the installation instructions I’ve provided above or access installation instructions from the CloudSmith website. All in all I rate this software highly—and being that we now finally have a 1.0.0 release its quite exciting to see the Puppet language handled so well by such a mature editor. Thanks CloudSmith!