Upgrading modules to Puppet 8

When upgrading officially supported Puppet modules, the work happens in three main stages: preliminary work, dependency update, and testing.

Preliminary work

The goal of the preliminary work stage is to get the modules ready for the jump to the new versions. Do this by removing deprecated code constructs and updating code accordingly. The biggest changes in Puppet 8 are in the Ruby layer, so the most common required changes are:

  • Assigning datatypes to class parameters

  • Replacing legacy facts with structured facts

  • General lint cleanup of top scope facts/variables

  • Cleaning up code to work with strict mode

You can use puppet-lint to highlight areas of concern. This means that a clean pdk validate run shows you what code must be corrected. However, first ensure that your modules don't have exceptions in place suppressing these warnings.

Dependency update

In the dependency update stage, update the various metadata.json and Gemfile files to ensure that the various modules have correct expectations. This process is partially performed using the pdk update command. However, you must still ensure that certain dependencies are correct manually.

For an example of the dependency update stage, see the following pull request:

Testing

In the final stage, run a series of manual and automated test runs to ensure that the module works as expected with all the updates applied. Testing infrastructure may vary depending on your specific modules, but one option is to run the Puppet Development Kit's comprehensive test suite against a large set of containers, representing all supported operating systems and Puppet versions.

Assuming the module has comprehensive testing coverage, passing tests indicates a successful Puppet 8 update.

Third party Forge modules

If you choose to validate third-party modules from the Forge, we recommend trusting the upstream author to do the update and validation.

Go to the Forge page for each module listed in your puppetfile and validate that it claims Puppet 8 compatibility. If it does not, then add a comment to that line of your puppetfile so that you know which modules to check next time you look at it. After you're finished, if there are any modules marked as not Puppet 8 compatible, just save the file and come back to it in a week or a month and try again.

More information

If you would like more information on the module upgrade process, including recommendations, tips and tricks, visit https://dev.to/puppet/updating-modules-to-puppet-8-58h3.