↓ Archives ↓

Category → faces

Redmine Ticket Face

Last week in a flurry of development I had an idea for another sub-command, this one designed to allow you to log trouble via the command line. It’s not hugely practical – you can query and create tickets – but I thought the example might prove useful to someone. It’s called Puppet-Ticket-Face.

Currently Puppet are only supported in Puppet 2.7.0 and later (2.7.0 is currently an RC but will hopefully be out soon!) and distributing them requires placing them into Puppet’s load path. They’ll shortly be distributable as Puppet modules using pluginsync.

So to install the GitHub face for now clone the git repository:

$ git clone git://github.com/jamtur01/puppet-ticket-face.git

Copy the relevant files into your Puppet master’s path (for example on Debian/Ubuntu into a source-based install).

$ cp -R lib/puppet/* /usr/local/lib/site_ruby/1.8/puppet

You can then see if the GitHub Face is installed like so:

$ puppet help

You should see the GitHub face listed in the available Puppet commands and you can now use it to query or create tickets. For example to list a ticket specify its ticket number:

$ puppet ticket list --ticket 1234

To create a ticket specify the create directive and the --token flag with your Redmine user API token (you can see it here).

$ puppet ticket create --token 123456789ABC

Hope someone finds this useful!

GitHub Puppet Face

I was looking at Jesse Newland’s excellent knife-github-cookbooks tool and thought that this would be an excellent tool to write for too. With the release of this is now incredibly easy to do. I created a tool called Puppet-GitHub-Face that allows you to install and compare from to in your Puppet module path.

Currently Puppet Faces are only supported in Puppet 2.7.0 and later (2.7.0 is currently an RC but will hopefully be out soon!) and distributing them requires placing them into Puppet’s load path. They’ll shortly be distributable as Puppet modules using pluginsync.

So to install the GitHub face for now clone the git repository:

$ git clone git://github.com/jamtur01/puppet-github-face.git

Copy the relevant files into your Puppet master’s path (for example on Debian/Ubuntu into a source-based install).

$ cp lib/puppet/application/github.rb /usr/local/lib/site_ruby/1.8/puppet/application/github.rb
$ cp lib/puppet/face/github.rb /usr/local/lib/site_ruby/1.8/puppet/face/github.rb

You can then see if the GitHub Face is installed like so:

$ puppet help

You should see the GitHub face listed in the available Puppet commands and you can now use it to install and compare installed modules. Let’s start with installing a module from Github, for example my puppet-httpauth module.

$ puppet github install --user jamtur01 --repo puppet-httpauth

This command will connect to GitHub, download the puppet-httpauth module and install it into your module path as the httpauth module (the Face automatically strips off prefix and suffix from a module, for example removing puppet-, puppet-module-, and -module from a repository name).

Warning! If a module of the same name is already in your path it’ll get deleted and replaced with this new module.

You can also compare the state of a currently installed module with its GitHub parent, like so:

$ puppet github compare --user jamtur01 --repo puppet-httpauth

This will return unified diff output showing any differences between the currently installed module and the module upstream on Github.

Hope someone finds this useful!