-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
59 lines (45 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
58
59
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu-trusty-64"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.hostmanager.enabled = true
config.hostmanager.include_offline = true
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
#configure ssh forward agent
`key_file=~/.ssh/id_rsa && [[ -z $(ssh-add -L | grep $key_file) ]] && ssh-add $key_file`
config.ssh.forward_agent = true
config.vm.define :dev_machine, primary: true do |node|
node.vm.hostname = "dev-machine.dev"
node.vm.network "private_network", ip: "10.0.0.2"
#forward port for rails
node.vm.network :forwarded_port, host: 3000, guest: 3000
node.vm.provision :shell, :path => "dev-machine-scripts/bootstrap.sh", privileged: false
node.vm.provision :copy_my_conf do |copy_conf|
copy_conf.git
copy_conf.vim
end
node.vm.provider "virtualbox" do |vb|
vb.name = "od4d-dev-env"
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
end
config.vm.define :app_server do |node|
node.vm.hostname = "app-server.dev"
node.vm.network "private_network", ip: "10.0.0.3"
node.vm.network 'forwarded_port', guest: 80, host: 10080
id_rsa_ssh_key_pub = File.read(File.join(Dir.home, ".ssh", "id_rsa.pub"))
config.vm.provision :shell, :inline => <<-eos
export APP_ENV="test"
export KEY_TO_AUTHORIZE="#{id_rsa_ssh_key_pub}"
/vagrant/app-server-scripts/bootstrap.sh
eos
node.vm.provider "virtualbox" do |vb|
vb.name = "od4d-app-server"
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
end
end