Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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 parse the array and mount two directories - /tmp/vagrant-puppet/modules-0 and /tmp/vagrant-puppet/modules-1 exactly as you need.