使用vagrant + Berkshelf,我試圖將我現有的虛擬機更新到更新的git
版本。通過Berksfile版本約束更新軟件
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
end
Berksfile
cookbook 'git', '>= 1.9.0'
請注意,我說的版本約束虛擬機創建後。
但是,在運行vagrant reload --version
時,沒有對git
版本進行軟件更新。
此外,銷燬VM,然後運行vagrant up --provision
不會導致安裝v 1.9.0(或更好版本)的git版本。
這是爲什麼?
這個問題被問及作爲項目的問題。 https://github.com/berkshelf/vagrant-berkshelf/issues/154 – sethvargo
對不起,我沒有指定,塞思 –