我正在研究将我的开发环境迁移到Vagrant,但在使用chef进行虚拟机自动化配置时遇到了些问题。我以前没有使用过chef,而且Vagrant文档在这方面的内容故意不详细(超出范围),所以需要帮助。
为了尽可能地实现可移植性,我想从URL加载cookbooks,因此在我的Vagrantfile
中尝试了如下操作:
config.vm.provision :chef_solo do |chef|
chef.recipe_url = 'https://github.com/opscode/cookbooks/tarball/master'
chef.add_recipe 'nginx'
chef.add_recipe 'mysql'
chef.add_role 'web'
# You may also specify custom JSON attributes:
# chef.json = { :mysql_password => '' }
end
我认为我并没有理解错什么,但是我没有找到一个似乎适用于这个Vagrant上下文的文档来源。
谢谢。