2

I've installed puppet modules as follows

% puppet module install puppetlabs-apache --environment production --target-dir /etc/puppet/environments/production/modules

How can I upgrade the puppetlabs-apache module?

puppet module upgrade tries to lookup the module within /etc/puppet directory

and puppet module upgrade doesnt have a target-dir flag to work with

manish
  • 315
  • 1
  • 3
  • 9

3 Answers3

1

I'll answer this myself for someone else who has the same confusion.

#) sudo puppet config print modulepath
/etc/puppet/environments/production/modules:/etc/puppet/modules:/usr/share/puppet/modules

puppet module upgrade command will search for module-to-be-upgraded in the above path.

manish
  • 315
  • 1
  • 3
  • 9
1

The puppet module upgrade command does not support this functionality, and there is a bug filed upstream about this.

However, since you can't always install into your module path you can just re-install the module using --target-dir like so:

puppet module install --target-dir /my/path --force name-module --version 1.0.1

YMMV when it comes to the dependencies if you use this method.

gregswift
  • 4,568
  • 1
  • 20
  • 8
0

The upgrade command should follow the priority of the directory listed from the output of your 'puppet config print modulepath'

meaning it will search: 1) /etc/puppet/environments/production/modules then 2) /etc/puppet/modules then 3) /usr/share/puppet/modules

I hope this helps

Glyn
  • 1