Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Support for vagrantconfig{_local}.yaml inspired by Mozillians
Browse files Browse the repository at this point in the history
  • Loading branch information
lmorchard committed Dec 8, 2011
1 parent ce1acfd commit 6bff9ed
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 28 deletions.
61 changes: 33 additions & 28 deletions Vagrantfile
@@ -1,45 +1,50 @@
#
# Vagrant setup for Kuma
#
Vagrant::Config.run do |config|

# This should get you a mostly ready-baked base box
config.vm.box = "kuma"
config.vm.box_url = "http://people.mozilla.com/~lorchard/vm/kuma.box"
config.package.name = "kuma.box"
require "yaml"

# Load up our vagrant config files -- vagrantconfig.yaml first
_config = YAML.load(File.open(File.join(File.dirname(__FILE__),
"vagrantconfig.yaml"), File::RDONLY).read)

# Local-specific/not-git-managed config -- vagrantconfig_local.yaml
begin
_config.merge!(YAML.load(File.open(File.join(File.dirname(__FILE__),
"vagrantconfig_local.yaml"), File::RDONLY).read))
rescue Errno::ENOENT # No vagrantconfig_local.yaml found -- that's OK; just
# use the defaults.
end

# Here's a box built with a not-too-old import included
# config.vm.box = "kuma-with-data"
# config.vm.box_url = "http://people.mozilla.com/~lorchard/vm/kuma-with-data.box"
# config.package.name = "kuma-with-data.box"
CONF = _config
MOUNT_POINT = "/vagrant"

# To rebuild from mostly scratch, use this CentOS 5.6 (32 bit) image:
# config.vm.box = "centos-56-32"
# config.vm.box_url = "http://people.mozilla.com/~lorchard/vm/centos-56-32.box"
Vagrant::Config.run do |config|

# Plain old VirtualBox shared folder in use here:
config.vm.share_folder("v-root", "/vagrant", ".")
config.vm.box = CONF['box']
config.vm.box_url = CONF['box_url']
config.package.name = CONF['package_name']

# On OS X and Linux you can use an NFS mount; virtualbox shared folders are slow.
# see also: http://vagrantup.com/docs/nfs.html
# config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true)
# nfs needs to be explicitly enabled to run.
if CONF['nfs'] == false or RUBY_PLATFORM =~ /mswin(32|64)/
config.vm.share_folder("v-root", MOUNT_POINT, ".")
else
config.vm.share_folder("v-root", MOUNT_POINT, ".", :nfs => true)
end

# This thing can be a little hungry for memory
config.vm.customize do |vm|
vm.memory_size = 768
vm.memory_size = CONF['memory_size']
end

# uncomment to enable VM GUI console, mainly for troubleshooting
if CONF['gui'] == true
config.vm.boot_mode = :gui
end

config.vm.network(CONF['ip_address'])

# Increase vagrant's patience during hang-y CentOS bootup
# see: https://github.com/jedi4ever/veewee/issues/14
config.ssh.max_tries = 50
config.ssh.timeout = 300

# uncomment to enable VM GUI console, mainly for troubleshooting
#config.vm.boot_mode = :gui

# Add to /etc/hosts: 192.168.10.55 developer-dev.mozilla.org
config.vm.network("192.168.10.55")

config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "dev-vagrant.pp"
Expand Down
12 changes: 12 additions & 0 deletions vagrantconfig.yaml
@@ -0,0 +1,12 @@
# Default config for Vagrant
#
# Don't change this; use vagrantconfig_local.yaml to override these settings
# instead.

nfs: false
gui: false
ip_address: 192.168.10.55
memory_size: 768
box: "kuma"
box_url: "http://people.mozilla.com/~lorchard/vm/kuma.box"
package_name: "kuma.box"
19 changes: 19 additions & 0 deletions vagrantconfig_local.yaml-dist
@@ -0,0 +1,19 @@
# Local configuration for Vagrant

# On OS X and Linux you can use an NFS mount; virtualbox shared folders are slow.
# see also: http://vagrantup.com/docs/nfs.html
nfs: true
gui: true

# Add to /etc/hosts: 192.168.10.55 developer-dev.mozilla.org
ip_address: 192.168.10.55

# This can get you a base box with MDN data already imported
# box: "kuma-with-data"
# box_url: "http://people.mozilla.com/~lorchard/vm/kuma-with-data.box"
# package_name: "kuma-with-data.box"

# Here be dragons: Use this base box to rebuild from scratch atop an almost
# bare OS.
# box: "centos-56-32"
# box_url: "http://people.mozilla.com/~lorchard/vm/centos-56-32.box"

0 comments on commit 6bff9ed

Please sign in to comment.