Skip to content

Instantly share code, notes, and snippets.

@adejoux
Last active August 27, 2020 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save adejoux/1f9cd6f775f5c430572b to your computer and use it in GitHub Desktop.
Save adejoux/1f9cd6f775f5c430572b to your computer and use it in GitHub Desktop.
vagrant chef configuration file
#use libvirt
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt'
VMCOUNT = (ENV['VMCOUNT'] || 1).to_i
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.5.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "virtualbox"
# Turn off shared folders
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
# Test vms
VMCOUNT.times do |number|
config.vm.define "vm#{number + 1}" do |config|
config.vm.hostname = "vm#{number + 1}"
# eth1
config.vm.network "private_network", ip: "10.0.0.#{10 + number }"
config.vm.provider "libvirt" do |libvirt|
#use the storage pool named external
libvirt.storage_pool_name = "external"
libvirt.driver = "kvm"
libvirt.memory = 1024
libvirt.cpus = 1
libvirt.nested = true
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment