-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
60 lines (46 loc) · 2.02 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -*- mode: ruby -*-
# vi: set ft=ruby :
# CONFIGURATION
# mount directories from host to guest
shared_folders = {"#{Dir.home}/chef" => '/home/vagrant/chef'}
# shared_folders = {}
# VM with gui or headless
vm_gui = false
vm_memory = 1024
vm_cpus = 1
# vm_forward_ssh_port = 20022
# copy SSH key and config files from host to guest box
copy_ssh_files = true
# ---- PLEASE, DO NO EDIT AFTER THIS LINE ----
# Vagrantfile API/syntax version
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'chef-takeaway-0.3.1'
config.vm.box_url = 'http://b978c36202e860131550-3189a12cbb993ba67efdf7b3557152c8.r36.cf4.rackcdn.com/virtualbox/chef-takeaway-0.3.1.box'
# config.ssh.username = 'vagrant'
# config.ssh.password = 'vagrant'
config.vm.hostname = 'chef-takeaway'
config.vm.hostname = 'chef-takeaway'
# config.vm.network :forwarded_port, guest: 22, host: vm_forward_ssh_port, id: 'ssh', auto_correct: false
config.vm.provider :virtualbox do |vb|
vb.gui = vm_gui
vb.memory = vm_memory
vb.cpus = vm_cpus
end
# Uncomment below to enable NFS for sharing the host machine into the VM, e.g.:
#
# config.vm.synced_folder ".", "/home/foo/share", id: "vagrant", :nfs => true, :mount_options => ['nolock,vers=3,udp']
#
shared_folders.each_with_index do |(host_folder, guest_folder), index|
if File.directory?(host_folder)
puts "synced folder host_folder:#{host_folder.to_s} --> guest_folder:#{guest_folder.to_s}"
# config.vm.synced_folder host_folder.to_s, guest_folder.to_s, id: config.vm.hostname, nfs: true, mount_options: ['nolock,vers=3,udp'], create: true
config.vm.synced_folder host_folder.to_s, guest_folder.to_s, id: config.vm.hostname, create: true
else
puts "Warning - host_folder #{host_folder.to_s} does not exist"
end
end
# copy files to guest box
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
config.vm.provision "file", source: "#{Dir.home}/.ssh/config", destination: ".ssh/config"
end