Chapter 18. Publishing Modules

This chapter will cover how to share your module with others, both inside and outside of your organization.

This chapter makes numerous references to the Puppet Forge, but nearly every case is also true of private forges hosted internally by organizations.

Updating the Module Metadata

First, review and update the Chapter 16. In particular, make sure that the following files have been created, and are up to date:

Every one of these files is used by the Puppet Forge to create details for users of your module.

One feature of the metadata we didn’t discuss previously was keyword tags. These are used by the Puppet Forge search engine to help users find your module.

Update the metadata.json file to include an array of keyword tags relevant to your project. Tags cannot contain spaces, and should not match any valid value from $facts['operatingsystem'].

  "tags": [ "agent", "server" ],
Tip
As this file is standard (picky) JSON format, make sure to remove single quotes and trailing commas.

Packaging a Module

After verifying the metadata is accurate, use puppet module build to package the module.

$ puppet module build
Notice: Building jorhett-puppet for release
Module built: jorhett-puppet/pkg/jorhett-puppet-1.2.1.tar.gz

Note that the ...

Get Learning Puppet 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.