So I have my Vagrant file set up like this:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "modules"
puppet.options = "--verbose --debug"
end
end
Now when I vagrant ssh
into my VM and then run puppet module install puppetlabs-apache
, i get the following error:
Error: Could not install module 'puppetlabs-apache' (latest)
Directory /home/vagrant/.puppet/modules does not exist
So what I tried was:
mkdir -p /home/vagrant/.puppet/modules
followed by:
puppet module install puppetlabs-apache
and it worked!
But the module files are not showing up in my host machine under the "modules"
directory that I set in my Vagrantfile. So I guess the puppet.module_path
isn't working..?
Thanks :)
Invoking
puppet
inside your VM is not the same as Puppet as it is used for provisioning from the host.The Puppet resources that Vagrant uses are part of the Vagrant project. As you can see, the Puppet command inside the VM uses either
~/.puppet
or/etc/puppet
The Puppet configuration is not shared between host and VM.