-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
50 lines (38 loc) · 1.87 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Example Multi-Box edited by Jessica Rankins 4/17/2017
ADDITIONALFILES = Dir.pwd + "/VagrantMultiAdditionalFiles"
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version.
Vagrant.configure("2") do |config|
config.vm.synced_folder Dir.pwd, "/vagrant", disabled: true
config.vm.box = "hashicorp/precise64"
# Configure the Web Server
config.vm.define "WebExampleBox" do |web|
web.vm.provider :virtualbox do |vb|
vb.name = "WebBox"
vb.memory = 1024
vb.customize ["modifyvm", :id, "--description", "WebBox is an apache VM used to demonstrate Infrastructure as code principles via Vagrant. It is also used to demonstrate defining multiple machines in a single Vagrantfile."]
end
# After vagrant up, should see VM's web page in browser at 192.168.3.5
web.vm.network "private_network", ip: "192.168.3.5"
web.vm.hostname = "Web"
web.vm.synced_folder ADDITIONALFILES, "/var/www"
web.vm.provision :shell, path: "web_provision.sh"
# display this message at end of vagrant up
config.vm.post_up_message = "Successfully started Web."
end
# Configure the Database
config.vm.define "DBExampleBox" do |db|
db.vm.provider :virtualbox do |vb|
vb.name = "DBBox"
vb.memory = 1024
vb.customize ["modifyvm", :id, "--description", "DBBox is a mysql VM used to demonstrate Infrastructure as code principles via Vagrant. It is also used to demonstrate defining multiple machines in a single Vagrantfile."]
end
db.vm.hostname = "DB"
db.vm.provision :shell, path: "db_provision.sh"
db.vm.network "private_network", ip: "192.168.3.6"
# display this message at end of vagrant up
config.vm.post_up_message = "Successfully started DB."
end
end # End configuring