-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
45 lines (37 loc) · 1.31 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
Vagrant.configure(2) do |config|
# configuration common to all VMs goes here
#
config.vm.box = "punktde/freebsd-133-ufs"
config.vm.synced_folder '.', '/vagrant', id: 'vagrant-root', disabled: true
config.vm.synced_folder '.', '/var/vagrant', :nfs => true, :nfs_version => 3
# bring those memory and CPU requirements down a bit
#
config.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
# provision a common hosts file to all VMs
#
config.vm.provision 'shell', inline: <<-SHELL
# get rid of Linuxism inserted by Vagrant
sed -i '' '/127\.0\.1\.1/d' /etc/hosts
# add the IP addresses of the three nodes
grep -q node1 /etc/hosts || echo "192.168.56.51 node1" >>/etc/hosts
grep -q node2 /etc/hosts || echo "192.168.56.52 node2" >>/etc/hosts
grep -q node3 /etc/hosts || echo "192.168.56.53 node3" >>/etc/hosts
SHELL
# configuration for individual VMs
#
config.vm.define "node1" do |node1|
node1.vm.hostname = 'node1'
node1.vm.network 'private_network', ip: '192.168.56.51'
end
config.vm.define "node2" do |node2|
node2.vm.hostname = 'node2'
node2.vm.network 'private_network', ip: '192.168.56.52'
end
config.vm.define "node3" do |node3|
node3.vm.hostname = 'node3'
node3.vm.network 'private_network', ip: '192.168.56.53'
end
end