Skytap Metadata into Facter Facts

Puppet's Facter is great, and a great way to collect data for use with Puppet. With our dev/test workflow existing in Skytap, we wanted to have better access to the Skytap metadata so we could leverage that in Puppet.

Here is our solution to that...

The module 'module_skytap_metadata'  goes to the skytap metadata service and takes that returned JSON and re-parses it slightly, then adds them as Facter facts.

It takes all of the metadata values and prepends "skytap_" to them, grouping them all within the full list of Facter facts.

As an added bonus, it goes into the userdata of the VM and, if there's YAML there, will parse that as well creating 'skytap_userdata_xxxxx' values. This allows a tester to add values to the userdata themselves, which will flow all the way down to Facter and, ultimately, Puppet.

For us, this let's a tester mark a system for a given customer in Skytap, and Puppet can handle any customer specific setup needed. Handy for testing, POC, and otherwise giving power to the users themselves in a self-service way.

A system's user data that will end up as Facter facts.

A system's user data that will end up as Facter facts.

Our module_skytap_metadata is available on Github here: