mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-24 18:06:16 +07:00
f191d5a2e2
Because of LXD fan networking issue Can ping containers in different node
23 lines
552 B
Ruby
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
|