所以我的Vagrant文件设置如下:
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现在,当我通过vagrant ssh进入我的虚拟机,然后运行puppet module install puppetlabs-apache时,我得到以下错误:
Error: Could not install module 'puppetlabs-apache' (latest) Directory /home/vagrant/.puppet/modules does not exist
所以我尝试的是:
mkdir -p /home/vagrant/.puppet/modules
然后是:
puppet module install puppetlabs-apache
它成功了!
但是模块文件没有显示在我的主机上的"modules"目录下,这个目录是我在Vagrantfile中设置的。所以我猜puppet.module_path不工作了..?
谢谢:)
发布于 2014-09-01 01:28:02
在您的VM中调用puppet与Puppet不同,因为它用于从主机进行资源调配。
Vagrant使用的Puppet资源是Vagrant项目的一部分。正如您所看到的,VM中的Puppet命令使用
~/.puppet中的
/etc/puppet中的
主机和虚拟机之间不共享Puppet配置。
https://stackoverflow.com/questions/25590651
复制相似问题