Skip to content

Instantly share code, notes, and snippets.

@jeff-minard-ck
Created January 10, 2014 16:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeff-minard-ck/8357312 to your computer and use it in GitHub Desktop.
Save jeff-minard-ck/8357312 to your computer and use it in GitHub Desktop.
vagrant file with HD provisioning
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "2creatives-centos65-652"
config.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.2/centos65-x86_64-20131219.box"
config.vm.hostname = "mymachine.com"
config.vm.synced_folder "salt/root/", "/srv/"
config.vm.provider "virtualbox" do |v|
v.name = 'me'
v.customize ["modifyvm", :id, "--memory", "2048"]
v.customize ["modifyvm", :id, "--ioapic", "on"]
v.customize ["modifyvm", :id, "--cpus", "4"]
v.customize ["modifyvm", :id, "--cpuexecutioncap", "75"]
disks = [
{ :id => 1, :path => './vdi/git.vdi', :size => 16*1024 },
{ :id => 2, :path => './vdi/db.vdi', :size => 16*1024 }
]
disks.each do |disk|
unless File.exist?(disk[:path])
v.customize ['createhd', '--filename', disk[:path], '--size', disk[:size]]
end
end
disks.each do |disk|
v.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', disk[:id], '--device', 0, '--type', 'hdd', '--medium', disk[:path]]
end
end
config.vm.provision :salt do |salt|
salt.minion_config = './salt/minion'
salt.run_highstate = true
salt.verbose = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment