khuedoan-homelab/test/Vagrantfile
Khue Doan f191d5a2e2 Switch to Ubuntu from Debian
Because of LXD fan networking issue

Can ping containers in different node
2021-02-21 20:58:06 +07:00

23 lines
552 B
Ruby

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
(0..1).each do |i|
config.vm.define "metal#{i}" do |metal|
metal.vm.network "private_network", ip: "192.168.50.#{i+2}"
end
end
config.vm.provider "virtualbox" do |vb|
vb.cpus = 2
vb.memory = "4096"
end
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "/tmp/id_rsa.pub"
config.vm.provision "shell", inline: <<-SHELL
apt-get update
mkdir /root/.ssh
cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys
SHELL
end