Puppet 2.7.19
Vagrant version 1.0.6
VM OS Ubuntu 12.04
我正在尝试从 vagrant 设置 puppet 模块路径。这看起来应该很简单。
在我的流浪文件中,我有:
Vagrant::Config.run do |config|
config.vm.provision :puppet, :module_path => "my_modules"
config.vm.provision :puppet, :options => ["--modulepath", "my_modules"]
end
当我更改模块路径的值时,它似乎没有效果(之后vagrant reload
)
这是一个片段vagrant up
[default] -- v-root: /vagrant
[default] -- manifests: /tmp/vagrant-puppet/manifests
[default] -- v-pp-m0: /tmp/vagrant-puppet/modules-0
注意/tmp/vagrant-puppet/modules-0
? 这是关于什么的?
然后从 vagrant 内部:
vagrant@precise64:~$ puppet apply --configprint modulepath
/home/vagrant/.puppet/modules:/usr/share/puppet/modules
所以当我这样做时:puppet module install puppetlabs/mysql
我收到此错误:
Preparing to install into /home/vagrant/.puppet/modules ...
Error: Could not install module 'puppetlabs-mysql' (latest)
Directory /home/vagrant/.puppet/modules does not exist
所以我必须要:
vagrant@precise64:~/.puppet$ mkdir /home/vagrant/.puppet/modules
vagrant@precise64:~/.puppet$ puppet module install puppetlabs/mysql
Preparing to install into /home/vagrant/.puppet/modules ...
Downloading from http://forge.puppetlabs.com ...
Installing -- do not interrupt ...
/home/vagrant/.puppet/modules
└─┬ puppetlabs-mysql (v0.6.1)
└── puppetlabs-stdlib (v3.2.0)
然后我必须将模块移动到 vagrant 可以看到它们的位置......
mv /home/vagrant/.puppet/modules/mysql /tmp/vagrant-puppet/modules-0
似乎这可能是一个错误,或者我真的错过了一些东西。看起来很基本,所以我想听听其他人是如何解决这个问题的。
谢谢!