使用 vagrant + Berkshelf,我正在尝试将我已经存在的 VM 更新到更新的git
版本。
流浪文件
# -*- 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
end
伯克斯文件
cookbook 'git', '>= 1.9.0'
请注意,我在创建 VM 后添加了版本约束。
但是,在运行时vagrant reload --version
,没有对该git
版本进行任何软件更新。
此外,销毁 VM,然后运行vagrant up --provision
不会导致安装 git 的 v 1.9.0(或更好)版本。
为什么?