-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patholdVagrantile
More file actions
52 lines (36 loc) · 1.55 KB
/
oldVagrantile
File metadata and controls
52 lines (36 loc) · 1.55 KB
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
config.vm.box = conf['vagrant_box']
config.vm.box_version = conf['vagrant_box_version']
### folder settings for each vm###
conf['synced_folders'].each do | synced_folder_name, synced_folder_value |
src = synced_folder_value['src']
dst = synced_folder_value['dst']
config.vm.synced_folder src, dst, type: set_sharing_folder_protocol(), mount_options: set_mount_option()
end
### network settings ####
config.vm.network "private_network", type: "dhcp"
config.ssh.forward_agent = true
conf['forwarded_ports'].each do | application_name, forwarded_port_value |
internal_port = forwarded_port_value['internal_port']
external_port = forwarded_port_value['external_port']
config.vm.network "forwarded_port", guest: internal_port, host: external_port
end
# provision section
$script = <<-SCRIPT
sudo apt-get install -y git unzip
SCRIPT
config.vm.provision "shell", inline: $script
#configure bashrc.d seletcing what you need
config.vm.provision "shell", path: "configure_bashrcd.sh", privileged: false , args: "~/.bashrc"
if conf['bashrcd'].nil? then
puts "nothing to add to bashrc.d"
else
conf['bashrcd'].each do | name, filename |
source_filename = "bashrc.d/" + filename['source_file']
destination_filename = "~/" + "bashrc.d/" + name + ".bash"
config.vm.provision "file", source: source_filename, destination: destination_filename
end
end
config.vm.provider conf['hypervisor'] do |v|
v.memory = conf['machine']['memory']
v.cpus = conf['machine']['cpu']
end