-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile.example
106 lines (87 loc) · 3.03 KB
/
Vagrantfile.example
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
require 'yaml'
settings = YAML.load_file(File.join(__dir__, 'vagrant.yml'))
localpath = settings[:synced_folder][:localpath]
guestpath = settings[:synced_folder][:guestpath]
if settings.key?(:hardware)
cpus = settings[:hardware][:cpus]
memory = settings[:hardware][:memory]
else
cpus = 2
memory = 4096
end
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Ubuntu 14.04
config.vm.box = "ubuntu/trusty64"
#config.proxy.http = ""
#config.proxy.https = ""
#config.proxy.no_proxy = ""
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network :private_network, ip: "192.168.33.10"
# The hostname the machine should have. If set to a string, the hostname
# will be set on boot.
# will be set on boot.
#config.vm.hostname = "vm.example.com"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network :public_network
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder localpath, guestpath
config.vm.provider :virtualbox do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.cpus = cpus
vb.memory = memory
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
#config.omnibus.chef_version = "11.16.4"
config.vm.provision :chef_solo do |chef|
#chef.http_proxy = ""
#chef.https_proxy = ""
#chef.no_proxy = ""
chef.cookbooks_path = ["cookbooks"]
chef.verbose_logging = true
# chef.log_level = "debug"
# custom JSON attributes:
chef.json = {
"rvm" => {
"default_ruby" => "ruby-2.2.1",
"global_gems" => [
{ "name" => "bundler" },
{ "name" => "rails", "version" => "4.2.4" }
]
},
"java" => {
"install_flavor" => "oracle",
"jdk_version" => "8",
"oracle" => {"accept_oracle_download_terms" => true}
}
}
#### need proxy setting
chef.add_recipe "apt"
chef.add_recipe "build-essential"
chef.add_recipe "curl"
chef.add_recipe "git"
chef.add_recipe "nodejs"
chef.add_recipe "openssl"
chef.add_recipe "python"
#chef.add_recipe "phantomjs"
#chef.add_recipe "postgresql::client"
#chef.add_recipe "postgresql::server"
#chef.add_recipe "ruby_dev"
chef.add_recipe "rvm::system"
chef.add_recipe "rvm::vagrant"
chef.add_recipe "java"
chef.add_recipe "java::default_java_symlink"
chef.add_recipe "maven"
chef.add_recipe "mongodb3::default"
end
end