-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathVagrantfile
46 lines (39 loc) · 1.27 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.ssh.username = "vagrant"
config.ssh.private_key_path = ["#{ENV['HOME']}/.ssh/id_rsa"]
config.vm.synced_folder ".", "/vagrant", type: "rsync"
config.vm.hostname = "multipass-test"
config.vm.box = "multipass"
config.vm.provider "multipass" do |multipass, override|
multipass.hd_size = "10G"
multipass.cpu_count = 2
multipass.memory_mb = 2048
multipass.image_name = "focal"
end
(0..0).each do |i|
vm_name = "multipass-test-#{i}"
config.vm.define "#{vm_name}" do |subconfig|
subconfig.vm.hostname = vm_name
subconfig.trigger.after :up do |trigger|
trigger.info = "Get IP Address"
trigger.ruby do |env, machine|
puts machine.ssh_info
end
end
# Mount path is a sample of your OS (mac / linux)
subconfig.vm.provider "multipass" do |multipass, override|
multipass.hd_size = "5G"
multipass.cpu_count = 2
multipass.memory_mb = 2048
multipass.image_name = "focal"
multipass.mount_point = {
"/Users" => "/mnt/Users" # Sample mount path for MacOS Users
# "/home" => "/mnt/Users" # Sample mount path for Linux Users
}
end
subconfig.vm.provision "provision for #{vm_name}", type: "shell", inline: "cat /etc/hosts"
end
end
end