Skip to content

Instantly share code, notes, and snippets.

@dalmosantos
Created May 22, 2020 03:14
Show Gist options
  • Save dalmosantos/8e19f4154313dfe0f7a52bed4030e79d to your computer and use it in GitHub Desktop.
Save dalmosantos/8e19f4154313dfe0f7a52bed4030e79d to your computer and use it in GitHub Desktop.
Vagrant cluster Libvirt
Vagrant.configure('2') do |config|
config.vm.box = "centos/7"
config.vm.box_check_update = true
(51..53).each do |i|
config.vm.define "docker#{i}" do |node|
node.vm.hostname = "docker#{i}"
#node.vm.network "private_network", ip: "192.168.121.#{i}"
node.vm.network :private_network, ip: "192.168.123.#{i}"
node.vm.provider :kvm do |kvm, override|
kvm.memory_size = '2048m'
end
node.vm.provider :libvirt do |libvirt, override|
libvirt.memory = 2048
libvirt.nested = true
end
end
end
config.vm.provision "shell", inline: <<-SHELL
yum clean all && yum repolist && yum upgrade -y
curl -fsSL get.docker.com |bash
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment