manish
manish

Reputation: 315

how to upgrade puppet module in target-dir

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

Upvotes: 2

Views: 2841

Answers (3)

gregswift
gregswift

Reputation: 4746

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.

Upvotes: 1

Glyn
Glyn

Reputation: 1

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

Upvotes: 0

manish
manish

Reputation: 315

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.

Upvotes: 1

Related Questions