-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathVagrantfile
61 lines (51 loc) · 1.66 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
60
61
# -*- mode: ruby -*-
# # vi: set ft=ruby :
# General cluster configuration
$swarm_manager_instances = 3
$swarm_manager_instance_memory = 2048
$swarm_manager_instance_cpus = 1
$swarm_worker_instances = 3
$swarm_worker_instance_memory = 2048
$swarm_worker_instance_cpus = 1
Vagrant.configure("2") do |config|
# SSH configuration
config.ssh.insert_key = false
config.ssh.forward_agent = true
# Hostmanager
config.hostmanager.enabled = true
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
# Box management: CoreOS
config.vm.box = "coreos-stable"
config.vm.box_url = "https://storage.googleapis.com/stable.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json"
# Swarm manager instances configuration
(1..$swarm_manager_instances).each do |i|
config.vm.define vm_name = "swarm-manager-%02d" % i do |master|
# Name
master.vm.hostname = vm_name
# RAM, CPU
master.vm.provider :virtualbox do |vb|
vb.gui = false
vb.memory = $swarm_manager_instance_memory
vb.cpus = $swarm_manager_instance_cpus
end
# IP
master.vm.network :private_network, ip: "10.0.0.#{i+110}"
end
end
# Swarm worker instances configuration
(1..$swarm_worker_instances).each do |i|
config.vm.define vm_name = "swarm-worker-%02d" % i do |worker|
# Name
worker.vm.hostname = vm_name
# RAM, CPU
worker.vm.provider :virtualbox do |vb|
vb.gui = false
vb.memory = $swarm_worker_instance_memory
vb.cpus = $swarm_worker_instance_cpus
end
# IP
worker.vm.network :private_network, ip: "10.0.0.#{i+120}"
end
end
end