How to manage puppet nodes with different module versions

puppet

I have a setup where we would like to have puppet manage installation and configuration of our software across several servers, but be able to install different versions of the software on different servers.

For example, I want to be able to create a puppet module that contains the server config, dependencies, etc for our version 1.0 and a separate one for version 1.1. From a single puppet master install, I would like to be able to configure some nodes to run version 1.0 and other nodes to run 1.1.

I see that modules allow meta data including a version, but it looks like you can have just one version of a module installed on a puppet master at a time.

Ideally it would be group based, where we can define an "early adopter" group and a "normal" group and as we come up with new versions we can set the early adopter group to use the new version and the normal group to use next oldest.

What is the best way to manage this?

Best Answer

There are several ways my favourites are the following three:

  • For our migration from apache1 to apache2 we created completely separate modules. You'd think this caused a lot of duplication, but we redid our config at the same time.
  • For simple upgrades of single packages, we do things like

    package{"foo":
        ensure => $wants_foo_upgrade ? {
            true => latest,
            false => 1.0
        }
    }
    

    where $wants_foo_upgrade is based on our infrastructure database, extlookup data or facts

  • For things in the middle, we take the second approach and use that variable in determining which configfiles to use, or in templates for configfiles.