UNPKG

1.37 kBPlain TextView Raw
1Vagrant.configure("2") do |config|
2 # Configuring the hostmanager to automatically alter the hosts file for development testing
3 config.hostmanager.enabled = true
4 config.hostmanager.include_offline = true
5 config.hostmanager.ignore_private_ip = false
6 config.hostmanager.manage_host = true
7
8 # Every Vagrant virtual environment requires a box to build off of.
9 config.vm.box = "precise64"
10 config.vm.box_url = "http://files.vagrantup.com/precise64.box"
11
12 # Configure 1GB (1024MB) of memory
13 config.vm.provider :virtualbox do |vb|
14 vb.customize ["modifyvm", :id, "--memory", 1024]
15 end
16
17 config.vm.define :local do |box|
18 box.vm.hostname = "local.<%= props.domain %>"
19
20 # Static IP for testing.
21 box.vm.network :private_network, ip: "<%= props.ip %>"
22 box.vm.network :forwarded_port, guest: 22, host: <%= props.ip.split('.').slice(-2).join('').slice(-4) %>
23
24 box.ssh.forward_agent = true
25
26 # Remount the default shared folder as NFS for caching and speed
27 box.vm.synced_folder ".", "/vagrant", :nfs => true
28
29 # Mount local SSH keys for deployments
30 box.vm.synced_folder "~/.ssh", "/home/vagrant/.ssh"
31
32 # Provision local.<%= props.domain %>
33 box.vm.provision :shell do |shell|
34 shell.inline = "/vagrant/bin/provision"
35 end
36 end
37
38 # Update IPs
39 config.vm.provision :hostmanager
40end