2021-02-21 09:55:26 +07:00
|
|
|
Vagrant.configure("2") do |config|
|
2021-02-21 20:58:06 +07:00
|
|
|
config.vm.box = "ubuntu/focal64"
|
2021-02-21 09:55:26 +07:00
|
|
|
|
|
|
|
(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
|
2021-02-21 20:58:06 +07:00
|
|
|
apt-get update
|
2021-02-21 10:46:00 +07:00
|
|
|
mkdir /root/.ssh
|
|
|
|
cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys
|
2021-02-21 09:55:26 +07:00
|
|
|
SHELL
|
|
|
|
end
|