On 17 June 2016 at 18:36, David Karr <davidmichaelk...@gmail.com> wrote: > I'm stepping through "Puppet for Containerization". The very first exercise > fails to start up the docker service, apparently because of an invalid > command-line option ("-d") sent to docker in the systemd service > description. This is being done by the "garethr/docker" Puppet module from > the forge. I determined that this was happening because the exercise was > specifying a somewhat older version of the module, and simply changing the > Puppetfile to use the newer version fixed the problem. Apparently this > option used to be valid in an older version of docker, but had since been > removed. > > It occurred to me that this situation likely happened because the Puppet > module was written a while ago, and it likely just specified to install the > latest version of docker. > > What I'd like to understand, at least in the scope of this particular module > (https://github.com/garethr/garethr-docker), and perhaps in general, what > exactly is a "best practice" for specifying an exact version of a dependency > to install, as I likely wouldn't have seen this error if the module > installed a specific version of Docker that this was known to work with. > > I did search through the code of the module, but although seeing that > perhaps > https://github.com/garethr/garethr-docker/blob/f1f701c5d4845c6dbb85d817d99a4cf9b0c2edae/manifests/params.pp > is where this might go, I didn't see a clear answer for how this might have > been changed to do that. > > Just so it's clear, I'm not suggesting that this change should be made in > this particular module, but if I did have a module that had to work with a > particular version of one or more dependencies, understanding how this > module would be changed to effect that might be a good guide in the future. >
The general approach is to set default values in the params.pp. In fact the module in question does that for Compose here: https://github.com/garethr/garethr-docker/blob/master/manifests/params.pp#L74 I took the decision to set the default to latest for the version of docker installed because Docker itself moves quite quickly. And you nearly always want the latest released version in this case imho. If instead I'd preferred to set a specific version for the module then I would have set a default value in params.pp here: https://github.com/garethr/garethr-docker/blob/master/manifests/params.pp#L6 (mainly because Docker moves quite quickly) they have a habit of breaking changes in minor versions. I try and call this out in the Changelog when this happens, for instance for this particular case: https://github.com/garethr/garethr-docker/blob/master/CHANGELOG.md#2016-02-12---version-51 Gareth > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/dbac3102-c2ec-4d26-8f71-7a51e992eeac%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Gareth Rushgrove @garethr devopsweekly.com morethanseven.net garethrushgrove.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAFi_6yKJRT-XXJMa8mB78LKQxjv-XZ5oTC_CBBoUEuKEhbjyTA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.