forked from FlowForwarding/LINC-Environment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
83 lines (69 loc) · 2.44 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# VirutalBox Guest Additions installer for ubuntu cloud images.
# Motivated by: https://github.com/dotless-de/vagrant-vbguest/issues/43#issuecomment-21780432
begin
require 'vagrant-vbguest'
class CloudUbuntuVagrant < VagrantVbguest::Installers::Ubuntu
def install(opts=nil, &block)
communicate.sudo('sed -i "/^# deb.*multiverse/ s/^# //" /etc/apt/sources.list ', opts, &block)
communicate.sudo('apt-get update', opts, &block)
communicate.sudo('apt-get -y -q purge virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11', opts, &block)
@vb_uninstalled = true
super
end
def running?(opts=nil, &block)
return false if @vb_uninstalled
super
end
end
vagrant_vbguest_installed = true
rescue LoadError
vagrant_vbguest_installed = false
end
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Choose the box. It it does not exists it will be downloaded.
config.vm.box = "ubuntu-12.04-amd64-daily"
# Set the url for the box.
config.vm.box_url =
"http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
# Share folders
config.vm.synced_folder "development", "/home/vagrant/development"
# Set the custom installer for VirtualBox Guest Additions.
if vagrant_vbguest_installed
config.vbguest.installer = CloudUbuntuVagrant
end
# Set the hostname
config.vm.hostname = "linc-dev"
# Enable X11 forwarding
config.ssh.forward_x11 = true
# VirtualBox provider configuration.
config.vm.provider :virtualbox do |vb|
# Set to true if you want the virtualbox to start the VM's UI
vb.gui = false
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
# Version of Chef to install in the box.
config.omnibus.chef_version = :latest
# Subdirectory config for librarian-chef
config.librarian_chef.cheffile_dir = "chef"
# Enable provisioning with Chef-Solo.
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "chef/cookbooks"
chef.json = {
:erlang => {
:install_method => 'esl'
},
:linc => {
:install_deps => true,
:install_ping_example => true
}
}
chef.add_recipe 'git'
chef.add_recipe 'erlang'
#chef.add_recipe 'xfce4'
chef.add_recipe 'linc'
chef.add_recipe 'wireshark_ofp'
chef.add_recipe 'mininet'
end
end