Skip to content

Instantly share code, notes, and snippets.

@yoloseem
Forked from dlutzy/gist:2469037
Last active December 18, 2015 04:49
Show Gist options
  • Save yoloseem/5728474 to your computer and use it in GitHub Desktop.
Save yoloseem/5728474 to your computer and use it in GitHub Desktop.
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{ :name => :web,
:role => 'web',
:ip => '192.168.33.1',
:http_fwd => 8080,
:shares => true },
{ :name => :db,
:role => 'db',
:ip => '192.168.33.2' },
{ :name => :memcached,
:role => 'memcached',
:ip => '192.168.33.3' },
]
Vagrant::Config.run do |config|
boxes.each do |opts|
config.vm.define opts[:name] do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.provision :shell,
:path => "setup.sh", :args => opts[:role]
config.vm.forward_port 80, opts[:http_fwd] if opts[:http_fwd]
config.vm.network :hostonly, opts[:ip]
config.vm.host_name = "%s.vagrant" % opts[:name].to_s
config.vm.share_folder "../", "/home/vagrant/stylesha.re", "../",
:nfs => false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment