Different versions of a puppet module within the same environment

Solution 1:

You can't have the same module multiple times in the same environment. If you need multiple versions of the same module you have to use different environments.

How I would implement this:

  • have a profile module at version 1.0 that depends on your module moduleA at version y. This will be installed on environment env1
  • when you need a new version of moduleA, you create a new profile at version 1.1 (or 2.0, doesn't matter) that will depend on the new version. You will install this on env2

If you use the puppet forge to keep your modules, you only need to update the metadata.json and pull the new profile with:

puppet module install profile --target-dir /etc/puppet/environments/envX