使用流浪汉+伯克大陆架,我正在尝试将我已经存在的VM更新为一个更新的git版本。
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos_64" # CentOS 6.5 box
config.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.1/centos65-x86_64-20131205.box" # URL of the `centos_64` box
config.berkshelf.enabled = true # use Berkshelf
config.omnibus.chef_version = :latest # install chef
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] # speed up networking on guest
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"] # ditto
vb.memory = 1024 # 1 GB RAM for guest VM
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "75"] # 75% of CPU goes to host VM.
end
endBerksfile
cookbook 'git', '>= 1.9.0'
注意,我在创建VM之后添加了version约束。
但是,在运行vagrant reload --version时,没有对git版本进行软件更新。
此外,销毁VM,然后运行vagrant up --provision并不会导致安装V1.9.0(或更高版本)版本的git。
为什么会这样呢?
发布于 2014-03-07 22:10:49
你错过了一个供给者:
config.vm.provision :chef_solo do |chef|
chef.add_recipe "git"
endhttps://stackoverflow.com/questions/22241325
复制相似问题