homeblogpuppet forge api and how it helped me blog about modules

The Puppet Forge API and how it helped me blog about modules

A while back, I rebooted Puppet’s series of recurring blog posts focused on new and updated modules on the Puppet Forge. For the first blog post, I collected the modules data entirely manually. Since this blog post was meant to be recurring — and since I work for Puppet :-) — I looked for a way to automate the collection of released module data.

Enter the Puppet Forge API

Jesse Scott, who works with me on the Puppet Developer Experience (PDE) team, pointed me to the Puppet Forge API. To quote the official documentation:

The Puppet Forge API (hereafter referred to as the Forge API) provides quick access to all the data on the Puppet Forge via a RESTful interface. Using the Forge API, you can write scripts and tools that interact with the Puppet Forge website. For example, you can use it to create custom aggregations against module metadata.

We discussed how we could use the Puppet Forge API to automate gathering released module information over a specific time frame. Our intern Austin Blatt set about writing the module roundup script. This script collects information about modules that have been released or updated by Puppet in the given timeframe. The script also lists the titles of modules updated or released in the same time fram by Vox Pupuli, a collective of Puppet module, tooling and documentation authors. We now use the modules roundup script on a regular basis to report on the progress of modules, both within Puppet and to the wider community.

What can Puppet Forge API do?

The Puppet Forge API includes a section that allows you to interact with the API and see real-time results. In this example, you can query the API for module releases based on criteria such as name, owner, date, Supported status, and more. There are also examples of querying the API by user and module.

The Forge API is used by such tools as r10k, the Puppet module tool and librarian-puppet to query and install modules. Take a look at the documentation and see what the Puppet Forge API can do for you.

Craig Gomes is an engineering manager at Puppet.

Learn more

  • Have you tried Puppet Enterprise yet? If not, you can download our Learning VM for free and get a hands-on experience of how Puppet Enterprise can help you automate all the things.