-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile.rb
57 lines (51 loc) · 1.86 KB
/
Vagrantfile.rb
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
47
48
49
50
51
52
53
54
55
56
57
SHARED_SYNC_ROOT = "shared"
LINUX_VM_NAME = "linux_workspace"
WINDOWS_VM_NAME = "windows_workspace"
NAME_PREFIX = "mji"
DEFAULT_RAM = 4 * 1024
TIMEOUT = 5 * 60
Vagrant.configure("2") do |config|
config.vm.boot_timeout = TIMEOUT
config.vm.synced_folder ".",
"/vagrant",
disabled: true
config.vm.define LINUX_VM_NAME do |ws|
ws.vm.box = "ubuntu/kinetic64"
ws.vm.synced_folder "packages/provision", "/vagrant"
ws.vm.synced_folder "#{SHARED_SYNC_ROOT}/#{LINUX_VM_NAME}",
"/home/vagrant/shared",
owner: "vagrant",
group: "vagrant",
create: true
ws.vm.provision "ansible_local" do |ansible|
ansible.galaxy_roles_path = "/etc/ansible/roles"
ansible.galaxy_role_file = "requirements.yml"
ansible.galaxy_command = "sudo ansible-galaxy install --role-file=%{role_file} --roles-path=%{roles_path} --force"
ansible.playbook = "playbook.yml"
ansible.limit = "all"
ansible.version = "latest"
end
ws.vm.provider "virtualbox" do |vb|
vb.name = "#{NAME_PREFIX}_#{LINUX_VM_NAME}"
vb.gui = false
vb.cpus = 2
vb.memory = DEFAULT_RAM
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "100", "--nested-hw-virt", "on"]
end
end
config.vm.define WINDOWS_VM_NAME do |ws|
ws.vm.box = "morajlab/windows-11"
ws.vm.synced_folder SHARED_SYNC_ROOT,
"C:/Users/vagrant/shared",
owner: "vagrant",
group: "vagrant",
create: true
ws.vm.provider "virtualbox" do |vb|
vb.name = "#{NAME_PREFIX}_#{WINDOWS_VM_NAME}"
vb.gui = false
vb.cpus = 2
vb.memory = DEFAULT_RAM
vb.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
end
end
end