khuedoan-homelab/test/Vagrantfile

23 lines
552 B
Ruby
Raw Normal View History

2021-02-21 09:55:26 +07:00
Vagrant.configure("2") do |config|
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
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