因此,我使用以下命令创建了一个 Vagrant 框:
vagrant package --base box_name_here --vagrantfile Vagrantfile --include manifests/
manifests/
是一个包含 puppet list 的目录和一些子目录,其中包含在配置过程中使用的一些文件。 Puppet 在 Vagrantfile 中被调用,如下所示:
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "web-dev.pp"
end
当我浏览 Vagrant 创建的打包 .box 存档时,我看到位于
box_name_here.box/includes/manifests
的文件夹。 .然而,
vagrant up
当我尝试运行它时,出现以下错误:
The manifests path specified for Puppet does not exist: c:/vagrant/manifests
文件在其他地方吗?
我看到了这个帖子: https://github.com/mitchellh/vagrant/issues/344
但答案有点不透明。我不太清楚如何将 modulepath 响应转换为我的 manifests_path 问题。
我更改了 vagrantfile 以便该行读取
puppet.manifests_path = "./manifests"
……但这并没有解决问题。我仍然收到相同的错误消息。
请您参考如下方法:
经过一些实验,令人难以置信的明显答案是:
puppet.manifests_path = File.expand_path("../manifests", __FILE__)