Skip to content

Commit 0a217fc

Browse files
Gabriel MonroyMatthew Fisher
authored andcommitted
refactor(vagrant): new CoreOS Vagrantfile
1 parent 8110aaf commit 0a217fc

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

Vagrantfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- mode: ruby -*-
2+
# # vi: set ft=ruby :
3+
4+
require_relative 'contrib/coreos/override-plugin.rb'
5+
6+
Vagrant.configure("2") do |config|
7+
config.vm.box = "coreos-alpha"
8+
config.vm.box_url = "http://storage.core-os.net/coreos/amd64-usr/alpha/coreos_production_vagrant.box"
9+
10+
config.vm.provider :vmware_fusion do |vb, override|
11+
override.vm.box_url = "http://storage.core-os.net/coreos/amd64-usr/alpha/coreos_production_vagrant_vmware_fusion.box"
12+
end
13+
14+
# Fix docker not being able to resolve private registry in VirtualBox
15+
config.vm.provider :virtualbox do |vb, override|
16+
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
17+
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
18+
end
19+
20+
# plugin conflict
21+
if Vagrant.has_plugin?("vagrant-vbguest") then
22+
config.vbguest.auto_update = false
23+
end
24+
25+
config.vm.define vm_name = "deis" do |config|
26+
config.vm.hostname = vm_name
27+
28+
ip = "172.17.8.100"
29+
config.vm.network :private_network, ip: ip
30+
31+
# Uncomment below to enable NFS for sharing the host machine into the coreos-vagrant VM.
32+
config.vm.synced_folder ".", "/home/core/share", id: "core", :nfs => true, :mount_options => ['nolock,vers=3,udp']
33+
34+
# workaround missing /etc/hosts
35+
config.vm.provision :shell, :inline => "echo 127.0.0.1 #{vm_name} > /etc/hosts", :privileged => true
36+
37+
# workaround missing /etc/environment
38+
config.vm.provision :shell, :inline => "touch /etc/environment", :privileged => true
39+
40+
# user-data bootstrapping
41+
config.vm.provision :file, :source => "contrib/coreos/user-data", :destination => "/tmp/user-data"
42+
config.vm.provision :shell, :inline => "mkdir -p /var/lib/coreos-vagrant && mv /tmp/user-data /var/lib/coreos-vagrant", :privileged => true
43+
44+
end
45+
46+
end

0 commit comments

Comments
 (0)