Module of the Week: Puppet Module Tool - Part 1

This week we're going to begin our coverage of the Puppet Module Tool (PMT). The PMT is the command-line interface to the Puppet Forge—an online repository for re-usable Puppet modules. As of Puppet 2.7.14 and Puppet Enterprise 2.5 PMT is no longer a separate product; it's now part of Puppet Core. What this means for you is that PMT is ready-to-go out of the box.

New features

The latest version of PMT offers a few new features over the previous stand-alone tool:

  • Search the Puppet Forge from the command line
  • List, upgrade, and uninstall modules
  • Automatically resolve and install module dependencies

In this post we'll take a look at the new search and list commands.

PMT Search

The search command searches a repository for modules whose names, descriptions, or keywords match the provided search term. For example, if we search for the term "tomcat", we would get the following output:

Notice the results include modules that match based on keywords and the module name.

PMT List

The list command lists the installed Puppet modules in our modulepath.

Notice the apache module has a version number of (???). This is because an apache module is installed but does not have a valid metadata file. If you would like to see how the installed modules relate to each other, use the --tree flag:

Highlighting problems

The list command will also report any issues with your module path:

The warning message is telling us that we are missing the puppetlabs-mysql module, which is required by the puppetlabs-bacula module. The PMT list command even lets us know which version of puppetlabs-mysql is required. A lot of work when into making the output communicate effectively. Notice the visual label used to highlight the "UNMET DEPENDENCY" in the tree output.

Conclusion

The new PMT is now bundled with Puppet and is ready to use out of the box. The new list and search commands allow you to search for modules on the Forge, and list currently installed modules. The list command also sports the ability to report issues with our installed modules.

Join us next week as we discover how to streamline the installation and maintenance of modules available on the Puppet Forge. We'll wrap up our coverage of the PMT by taking look at the new upgrade and uninstall commands. We'll also explore the enhancements made to the install command which greatly simplifies installing modules and their dependencies.

Additional Resources

Comments

pc2

pc2

quick questions:

- as puppet-module-tool have now been merged to puppet/module_tool does it also mean that the gem puppet-module (0.3.4) should be considered retired? if yes it might worth pointing this out somewhere to avoid confusion :-O

- I can't seem to make the gem version work with http proxy... tried HTTP_PROXY, http_proxy env vars and defining http_proxy_host/http_proxy_port in puppet.conf

James Turnbull

James Turnbull

1. The gem is being retired - we'll make that clear in the documentation.
2. I think there is a bug already logged with HTTP_PROXY and the tool and that it is not yet supported.

Leave a comment