-
Notifications
You must be signed in to change notification settings - Fork 11
/
Vagrantfile
49 lines (46 loc) · 1.3 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
# -*- mode: ruby -*-
# # vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
boxes = [
{
:name => "master",
:eth1 => "192.168.20.151",
:mem => "1024",
:cpu => "2"
},
{
:name => "node1",
:eth1 => "192.168.20.152",
:mem => "1024",
:cpu => "2"
},
{
:name => "node2",
:eth1 => "192.168.20.153",
:mem => "1024",
:cpu => "2"
}
]
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/xenial64"
# Turn off shared folders
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
#config.vm.synced_folder "~/works/codelab/cka/files", "/files"
# config.ssh.private_key_path = "~/.ssh/id_rsa"
# config.ssh.forward_agent = true
boxes.each do |opts|
config.vm.define opts[:name] do |config|
config.vm.hostname = opts[:name]
config.ssh.insert_key = true
# config.ssh.password = "vagrant"
config.vm.provider "virtualbox" do |v|
# v.gui = true
v.customize ["modifyvm", :id, "--memory", opts[:mem]]
v.customize ["modifyvm", :id, "--cpus", opts[:cpu]]
end
# config.vm.network :public_network
config.vm.network "private_network", ip: opts[:eth1], auto_config: true
end
end
end