Ask Your Question
2

How to separate 3rd party modules from own modules

asked 2013-08-25 13:17:54 -0500

radeksimko gravatar image

updated 2013-08-25 16:13:41 -0500

There's many modules on forge.puppetlabs.com, which can be used easily right away, but when I decided to write my own modules, couple questions came up on my mind.

I will most probably want to keep my custom modules completely separated from existing downloaded/installed modules from forge (I still want to be able to smoothly upgrade all 3rd party modules), therefore I'll have two module paths.

As I want to use Puppet in dev environment (with Vagrant), I need to use it with puppet apply and the basic option --modulepath doesn't accept more than one ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2013-08-25 16:18:54 -0500

radeksimko gravatar image

updated 2013-08-25 16:20:46 -0500

When you use Puppet as a provisioner with Vagrant and have existing modulepath like this:

config.vm.provision :puppet do |puppet|
  puppet.module_path = '../puppet/modules/forge'
end

Vagrant will automatically mount chosen path to the VM as /tmp/vagrant-puppet/modules-0 and use that path when running puppet apply inside VM.

After looking into the Vagrant code (because it is documented nowhere), you'll see that the easy thing to do is just provide array of directories instead one directory as a string:

config.vm.provision :puppet do |puppet|
  puppet.module_path = [ '../puppet/modules/forge', '../puppet/modules/custom' ]
end

Vagrant will then ... (more)

edit flag offensive delete link more
5

answered 2013-08-25 15:47:53 -0500

Hello !

Even with Vagrant and puppet apply, modulepath takes multiple path, separator is :

I use :

cd /vagrant
sudo puppet apply --modulepath modules/internal/:modules:external/ manifests/sandbox.pp
edit flag offensive delete link more

Comments

OK, my assumptions were wrong, it turned out to be more of a Vagrant issue than Puppet issue, because when providing modulepath via Vagrantfile, it should actually be VM paths ...(more)

radeksimko gravatar imageradeksimko ( 2013-08-25 16:01:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-08-25 13:17:54 -0500

Seen: 4,342 times

Last updated: Aug 25 '13