forked from deis/deis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
57 lines (43 loc) · 1.77 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
# -*- mode: ruby -*-
# # vi: set ft=ruby :
require_relative 'contrib/coreos/override-plugin.rb'
DEIS_NUM_INSTANCES = (ENV['DEIS_NUM_INSTANCES'].to_i > 0 && ENV['DEIS_NUM_INSTANCES'].to_i) || 1
if DEIS_NUM_INSTANCES == 1
mem = 4096
cpus = 2
else
mem = 2048
cpus = 1
end
Vagrant.configure("2") do |config|
config.vm.box = "coreos-298.0.0"
config.vm.box_url = "http://storage.core-os.net/coreos/amd64-usr/298.0.0/coreos_production_vagrant.box"
config.vm.provider :vmware_fusion do |vb, override|
override.vm.box_url = "http://storage.core-os.net/coreos/amd64-usr/298.0.0/coreos_production_vagrant_vmware_fusion.box"
end
config.vm.provider :virtualbox do |vb, override|
# Fix docker not being able to resolve private registry in VirtualBox
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
# plugin conflict
if Vagrant.has_plugin?("vagrant-vbguest") then
config.vbguest.auto_update = false
end
(1..DEIS_NUM_INSTANCES).each do |i|
config.vm.define vm_name = "deis-#{i}" do |config|
config.vm.hostname = vm_name
config.vm.provider :virtualbox do |vb|
vb.memory = mem
vb.cpus = cpus
end
ip = "172.17.8.#{i+99}"
config.vm.network :private_network, ip: ip
# Enable NFS for sharing the host machine into the coreos-vagrant VM.
config.vm.synced_folder ".", "/home/core/share", id: "core", :nfs => true, :mount_options => ['nolock,vers=3,udp']
# user-data bootstrapping
config.vm.provision :file, :source => "contrib/coreos/user-data", :destination => "/tmp/vagrantfile-user-data"
config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true
end
end
end